The equilibrium geometries and the electronic structures for different locations of H atoms and ions in GaAs have been evaluated by first-principle local density functional methods. Discrete near-edge levels are induced in the bandgap by the interactions of hydrogen with the GaAs lattice, as well as by charge effects in the case of H ions. Radiative transitions between those conduction-band and valence-band near-edge states account for the main features of the emission bands observed in the photoluminescence spectra of hydrogenated III-V compounds.