We have studied the effect of rapid thermal annealing (RTA) on GaInNAs/GaAs quantum wells (QWs) grown by molecular-beam epitaxy using a dc plasma as the N source. It was found that RTA at low temperature (LT, 650 °C) and high temperature (HT, 900 °C) could both improve the QW quality significantly. To clarify the mechanism of quality improvement by RTA, a magnetic field perpendicular to the path of the N plasma flux was applied during the growth of the GaInNAs layers for the sake of comparison. It was found that LT-RTA mainly removed dislocations at interfaces related to the ion bombardment, whereas, HT-RTA further removed dislocations originating from the growth. LT-RTA caused only a slight blueshift of photoluminescence peak wavelength, probably due to defect-assisted interdiffusion of In–Ga at the QW interfaces. The blueshift caused by HT-RTA, on the other hand, was much larger. It is suggested that this is due to the fast defect-assisted diffusion of N–As at the QW interfaces. As defects are removed by annealing, the diffusion of In–Ga at interfaces would be predominant. © 2000 American Institute of Physics.