  We use a coupled model of the formation and evolution of galaxies and black
holes (BH) to study the evolution of active galactic nuclei (AGN) in a cold
dark matter universe. The model predicts the BH mass, spin and mass accretion
history. BH mass grows via accretion triggered by discs becoming dynamically
unstable or galaxy mergers (called the starburst mode) and accretion from
quasi-hydrostatic hot gas haloes (called the hot-halo mode). By taking into
account AGN obscuration, we obtain a very good fit to the observed luminosity
functions (LF) of AGN (optical, soft and hard X-ray, and bolometric) for a wide
range of redshifts (0<z<6). The model predicts a hierarchical build up of BH
mass, with the typical mass of actively growing BHs increasing with decreasing
redshift. Remarkably, despite this, we find downsizing in the AGN population,
in terms of the differential growth with redshift of the space density of faint
and bright AGN. This arises naturally from the interplay between the starburst
and hot-halo accretion modes. The faint end of the LF is dominated by massive
BHs experiencing quiescent accretion via a thick disc, primarily during the
hot-halo mode. The bright end of the LF, on the other hand, is dominated by AGN
which host BHs accreting close to or in excess of the Eddington limit during
the starburst mode. The model predicts that the comoving space density of AGN
peaks at z~3, similar to the star formation history. However, when taking into
account obscuration, the space density of faint AGN peaks at lower redshift
(z<2) than that of bright AGN (z~2-3). This implies that the cosmic evolution
of AGN is shaped in part by obscuration.
