Density-functional pseudopotential total-energy calculations have been a powerful tool in studies of the electronic and structural properties of semiconductors and simple metals. The inclusion of highly electronegative first-row elements such as oxygen and fluorine has not, in general, been tractable. In this paper we address the inherent difficulties and demonstrate that they can be overcome. Focusing on oxygen-silicon systems the precision of our method is demonstrated particularly through the study of angular stability of Si-O-Si bridge bonds in silica. The results predict bending to an equilibrium angle of 140°5°, as observed, with an energy gain of only 0.15 eV. © 1989 The American Physical Society.