The crystalline structure of GaN epilayers on (0001) SiC substrates has been studied using x-ray diffraction and transmission microscopy. The films were grown by metalorganic chemical vapor deposition, using AlN buffer layers. X-ray diffraction measurements show negligible strain in the epilayer, and a long-range variation in orientation. Transmission electron lattice images show that the AlN buffer layer consists of small crystallites. The nature of the buffer layer and its interfaces with the substrate and the GaN film is discussed. The defect structure of the GaN film away from the substrate consists mostly of threading dislocations with a density of ∼109 cm−2.