The end of the S phase of the cell cycle leads to G2 phase, which in turns leads to the M phase or mitosis. 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 the daughter cells. During G2 phase, cell increases the size, and centrosomes of animal cells, duplicated during S phase too, are positioned at opposite locations of the cytoplasm for starting the polymerization of the mitotic spindle during M phase.
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 prophase. 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, helped by some other kinases and phosphatases, triggers the starting of the M phase, so it is a checkpoint.