A critical point in device fabrication based on GaN is the controlled doping and the incorporation of impurities like, e.g., oxygen. We have explored the adsorption of oxygen at the wurtzite (0001) and (000 (1) over bar) GaN surfaces employing density-functional theory. Our results show that both surface orientations are very active towards oxygen adsorption, explaining the high oxygen concentrations typically observed in GaN. However, the (0001) and (000 (1) over bar) surfaces behave differently and oxygen incorporation is expected to be higher at the (000 (1) over bar) surface. The different reactivity is explained in terms of the specific structural configurations. (C) 1999 American Institute of Physics. [S0003-6951(99)02512-7].