The microstructure and the lateral epitaxy mechanism of formation of homoepitaxially and selectively grown GaN structures within windows in SiO2 masks have been investigated by transmission electron microscopy (TEM) and scanning electron microscopy (SEM). Three types of samples and each of their microstructures as a function of the geometry of the mask pattern and the selective growth parameters have been studied: GaN pyramids, GaN stripes oriented along  and  directions, and GaN continuous layers. Observations via TEM showed in all three types of samples that the laterally overgrown GaN exhibit four-to-six orders of magnitude reduction in the dislocation density compared to the vertically grown GaN films. Owing to the lateral epitaxy, the threading dislocations bend when the growth front changes from vertical to lateral, thus changing their character from being mostly threading dislocations of mixed or edge character, to being basal plane dislocations with lines parallel to the interfacial planes. The underlying GaN provided the crystallographic template for the initial vertical selective growth through the openings (windows) in the SiO2 mask. The GaN structures in these areas had a threading dislocations density of 108-1010 cm−2. Lateral growth of the GaN films over the amorphous SiO2 mask, resulted in a reduction of the dislocation density to <106 cm−2. The primary materials source for both the vertical and lateral growth of the structures was the vapor phase. Essentially no GaN deposited on the SiO2 because of the very low sticking coefficients of Ga and N species on SiO2. Thermal stress relaxation is responsible for the final morphology and microstructure in these selectively grown structures.