We elucidated the formation process for Ruddlesden-Popper-type defects during pulsed laser deposition of Sr rich SrTiO3 thin films by a combined analysis of in-situ atomic force microscopy, low energy electron diffraction and high resolution scanning transmission electron microscopy. At the early growth stage of 1.5 unit cells, the excess Sr results in the formation of SrO on the surface, resulting in a local termination change from TiO2 to SrO, thereby forming a Sr rich (2 × 2) surface reconstruction. With progressive SrTiO3 growth, islands with thermodynamically stable SrO rock-salt structure are formed, coexisting with TiO2 terminated islands. During the overgrowth of these thermodynamically stable islands, both lateral as well as vertical Ruddlesden-Popper-type anti-phase boundaries are formed, accommodating the Sr excess of the SrTiO3 film. We suggest the formation of thermodynamically stable SrO rock-salt structures as origin for the formation of Ruddlesden-Popper-type antiphase boundaries, which are as a result of kinetic limitations confined to certain regions on the surface.