  To address the problem concerning the early formation of stars in massive
galaxies, we present the results of a semi-analytic model of galaxy formation
which includes a physical description of starbursts triggered by galaxy
interactions. These originate from the destabilization of cold galactic gas
occurring in galaxy encounters, which in part feeds the accretion onto black
holes powering quasars, and in part drives circumnuclear starsbursts at
redshifts $z\approx 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 halos. Thus, at intermediate $z\approx 1.5-2$ we find that a
considerable fraction of the stellar content of massive galaxies is already in
place, at variance with the predictions of previous hierarchical models. 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\lesssim 2$ are
all in good agreement with the existing observations concerning the bright
galaxy population.
