I present the results of a semi-analytic model of galaxy formation which includes a physical description of starbursts. These originate from the destabilization of cold galactic gas occuring in galaxy encounters, which in part feeds the accretion onto black holes powering quasars, and in part drives circumnuclear starsbursts at redshifts z≈ 2–4, preferentially in massive objects. This speeds up the formation of stars in massive galaxies at high redshifts without altering it in low mass galactic haloes. Meanwhile, part of the destabilized gas fuels the accretion onto the central supermassive black holes that the quasar emit at their full Eddington rates. At lower z the galactic dynamical events are mostly encountered in hierarchically growing groups; now the refueling peters out, as the residual gas is exhausted while the destabilizing encounters dwindle. So, our model uniquely produces at z > 3 a rise, and at z ≲ 2.5 a decline of the bright quasar population as steep as observed. In addition, our results closely fit the observed luminosity functions of quasars, their space density at different magnitudes from z≈ 5 to z≈ 0, and the local mBH–σ relation. The star formation in massive haloes declines sharply due to the lack of available cold gas already converted into stars during the starbursts at high z. The resulting high-z star formation rate and B-band luminosity functions, and the luminosity and redshift distribution of galaxies in K-band at z ≲ 2 are all in good agreement with the existing observations concerning the bright galaxy population.