The origin of the X-ray background in the 2-10 keV energy range has been finally understood. The extremely deep surveys by Chandra in the Deep Field South (Giacconi et al. 2002; Rosati et al. 2002) and Deep Field North (Brandt et al. 2001; Barger et al. 2002) have shown that most, if not all, the XRB emission in that energy range has been resolved into single sources. In particular, the optical and X-ray properties of the sources in the deep fields are showing that the main contribution is provided by a population of obscured AGN. This confirms the main prediction of population synthesis models (e.g. Setti & Woltjer 1989; Comastri et al. 1995; Fabian et al. 1998; Gilli, Salvati & Hasinger 2001), which explain the XRB spectrum in the ~ 1 - 100 keV band as the emission integrated over cosmic time of unobscured and obscured AGN, the latter being more numerous by a factor of ~ 4 - 10. Once the origin of the 2-10 keV XRB is finally explained, the results from the deep surveys, combined with synthesis models, should put tighter constraints on the cosmological properties of the sources making the XRB, like their X-ray luminosity function and evolution (especially those of obscured AGN, which are still completely unknown), as well as their average obscuration as a function of redshift and luminosity.