High spectral resolution Fabry-Pérot observations of the [ O i ] 63.2 and 145.5 \mu m and [ C ii ] 157.7 \mu m fine structure lines are presented for the center of the Sagittarius B2 complex ( Sgr B2 ) . The data were obtained with the Long Wavelength Spectrometer on board the Infrared Space Observatory ( ISO ) . Both the [ O i ] 63.2 \mu m and the [ C ii ] 157.7 \mu m lines are detected in absorption . The upper state level of atomic oxygen at 145.5 \mu m is in emission . Whereas the [ O i ] 63.2 \mu m line is seen in absorption over the entire wavelength range -200 to 100 km s ^ { -1 } , the [ C ii ] 157.7 \mu m line displays a more complex profile : absorption occurs at velocities < 20 km s ^ { -1 } and emission comes from the Sgr B2 complex at velocities greater than 20 km s ^ { -1 } . Using observations of the CO isotopes and of the H i lines , absorption components can be associated with many clouds along the Sagittarius B2 line of sight . From these data , we were able to disentangle three different layers which contain atomic oxygen . These layers , as predicted by PDR models , are characterized by different forms of carbon in the gas phase , i.e . the C ^ { + } external layer , the C ^ { + } to C ^ { 0 } transition and the CO internal layer . We derive lower limits for the column densities of atomic carbon and oxygen of the order of \sim 10 ^ { 18 } cm ^ { -2 } and 3 \times 10 ^ { 19 } cm ^ { -2 } , respectively . An O ^ { 0 } /CO ratio of around 2.5 is computed in the internal cores of the clouds lying along the line of sight , which means that \sim 70 % of gaseous oxygen is in the atomic form and not locked into CO . The fact that the [ C ii ] 157.7 \mu m line is detected in absorption implies that the main cooling line of the interstellar medium can be optically thick especially in the direction of large star-forming complexes or in the nuclei of galaxies . This could partially account for the deficiency in the [ C ii ] 157.7 \mu m line which has been recently found toward infrared bright galaxies in ISO data .