The effect of high-temperature annealing on stress in AlxGa1-xN in different ambients and at different temperatures was studied using ultraviolet micro-Raman spectroscopy. Low (x=0.08) and high (x=0.31 and x=0.34) composition AlGaN, grown by metalorganic chemical vapor deposition (MOCVD) and molecular-beam epitaxy (MBE), were compared. Compositional and morphological changes were monitored using Auger electron spectroscopy (AES) and atomic force microscopy (AFM), respectively. The Raman results demonstrate that all samples exhibit maximum stress changes in the compressive direction when annealed in an air ambient. AES confirms this to be due to higher oxygen incorporation after annealing in the air ambient, and shows higher oxygen incorporation in the vicinity of cracks and defects. MOCVD and MBE samples of a similar composition were found to reach the same biaxial stress, despite differences in initial stress and growth temperature. Relaxation of a parabolic intercrack stress profile to homogeneous stress was observed with annealing in all ambients for cracked samples. AFM results on cracked samples show an increase in width of the primary cracks along the <2 (1) over bar(1) over bar0> directions, and the formation of secondary cracks along the <1 (1) over bar 00> directions. (C) 2003 American Institute of Physics.