The end of the S phase of the cell cycle leads to G2 phase, which in turns leads to the M phase. During G2 phase, there must be an increasing amount of molecules needed for M phase. G2 phase has been traditionally regarded as a transitional phase between S and M phases. However, during G2 phase, it is checked if any error occurred during DNA replication and if the DNA has been completely replicated. If something went wrong during S phase, M phase does not start until the errors are repaired. It is of great importance the detection of errors before M phase starts, otherwise they will be inherited by daughter cells. During G2 phase, cell increases in size, and centrosomes of animal cells, that were duplicated during S phase, are positioned at opposite locations in the cytoplasm. During M phase, centrosomes polymerize the mitotic spindle.
The moment where G2 phase finishes and M phase starts is not clearly established, and some authors suggest that it is actually in the middle of the mitotic pro-phase. Anyway, the end of G2 phase is mediated by the type I cyclin dependent kinase (CdK) and by B1 cyclin. B1 cyclin is synthesized during the late S phase. This CdK-I/B1 complex, helped by some other kinases and phosphatases, triggers the starting of the M phase, so it is a checkpoint.
Until recently, it was thought that G1 phase was the only key element for restricting the progress of the cell cycle because it is where the response to mitogens takes place. However, now we know that there is time window in G2 phase that determines decisions that will be taken in G1 phase. For example, there is a dephosphorylation process in G2 phase needed in G1 for sensing mitogens and takes a decision. Without this dephosphorylation, the cell proliferates even without mitogens during G1 phase. If there is no dephosphorylation during G2, the cell is committed to proliferate and G1 phase is quite short. Mitogens during G2 phase inhibit the dephosphorylation process.
Matson JP, Cook JG. 2017. Cell cycle proliferation decisions: the impact of single cell analyses. The FEBS journal. 284: 362-375.