Lateral heterostructures are important for exploring exotic physics, developing new devices and achieving device miniaturization1,2,3,4,5,6,7,8. Endo-epitaxial growth occurring in patterned templates presents a promising strategy to realize extensive patterned areas in heterostructures, as recently demonstrated with two-dimensional (2D) covalent materials9,10,11,12,13. However, the conventional lithography and etching processes used to prepare patterned templates are too aggressive for 2D lead halide perovskites, owing to their inherently soft and unstable ionic lattice14,15,16. Here we create square holes of controllable size within 2D lead halide perovskites, enabling the fabrication of continuous lateral heterostructures over large areas. We demonstrate that the square holes form through spontaneous etching, a process initiated by internal strain and stabilized along the [100]/[010] crystallographic direction. Furthermore, the size of the square holes can be controlled by adjusting the etching time and temperature. Moreover, by incorporating a rapid solvent evaporation growth technique, the edges of the square holes act as templates for epitaxial growth of another type of perovskite, incorporating different halide or metal ions. Finally, we realized a series of mosaic lateral heterostructures that can emit various colours for light-emitting devices. This synthesis of diverse 2D perovskite mosaic lateral heterostructures provides valuable insights into the structural characteristics of perovskites and offers a versatile material platform for the development of complex integrated emitting devices.