Effects of in situ annealing on the structural and optical properties of Gallium nitride (GaN) layers grown on (0001) sapphire by hydride vapor phase epitaxy (HVPE) are studied. The properties of GaN epilayers are improved by insitu annealing at growth temperature under ammonia (NH3) atmosphere. X-ray diffraction (XRD) analysis shows that the full width at half maximum (FWHM) of the rocking curves narrows as the annealing time increases. Raman scattering spectroscopy shows that E2 (high) peak positions shift to the low frequency region. Compared to without annealing and epilayers annealed with bulk GaN,the E2 (high) peak position of epilayers becomes closer to that of bulk GaN as the in situ annealing time increases. The biaxial compressive stress decreases after in situ annealing. Photoluminescence (PL) examination agrees well with XRD and Raman scattering analyses. These results suggest that the optical and structural properties of GaN epilayers can be improved by in situ annealing.