We have studied the stability of the luminescence from porous Si in the presence of a variety of ambient gases (e.g., N2, H2, forming gas, and O2). Although the optical properties are fairly stable under most conditions, illumination in the presence of O2 causes a substantial decrease in luminescence efficiency. Infrared measurements show that the surfaces of degraded samples are oxidized. The luminescence lifetime of the degraded material is found to be substantially reduced, and the density of Si dangling bonds increases by more than two orders of magnitude, which suggests that oxidation of the surface introduces nonradiative recombination channels. These observations indicate that the electronic properties at the surface of the porous Si play a key role in obtaining efficient luminescence from this material.