In seismology, the mainshock is the largest earthquake in a sequence, sometimes preceded by one or more foreshocks, and almost always followed by many aftershocks.
[1][2][3] A foreshock is an earthquake that occurs before a larger seismic event (the mainshock) and is related to it in both time and space.
The designation of an earthquake as foreshock, mainshock or aftershock is only possible after the full sequence of events has happened.
Large earthquakes can have hundreds to thousands of instrumentally detectable aftershocks, which steadily decrease in magnitude and frequency according to known laws.
These are known as doublet earthquakes, and in general can be distinguished from aftershocks in having similar magnitudes and nearly identical seismic waveforms..