The objective of this work is to study how active galactic nuclei (AGN) influence star formation in host galaxies. We present a detailed investigation of the star-formation history and conditions of a z = 2.57 massive radio galaxy based on VLT/X-shooter and ALMA observations. The deep rest-frame ultraviolet spectrum contains photospheric absorption lines and wind features indicating the presence of OB-type stars. The most significantly detected photospheric features are used to characterize the recent star formation: neither instantaneous nor continuous star-formation history is consistent with the relative strength of the Si IIλ1485 and S Vλ1502 absorption. Rather, at least two bursts of star formation took place in the recent past, at 6+1-2 Myr and ≳20 Myr ago, respectively. We deduce a molecular H2 gas mass of (3.9 ± 1.0) × 1010 M⊙ based on ALMA observations of the [C I] 3P2−3P1 emission. The molecular gas mass is only 13% of its stellar mass. Combined with its high star-formation rate of (1020-170+190 M⊙ yr-1, this implies a high star-formation efficiency of (26 ± 8) Gyr−1 and a short depletion time of (38 ± 12) Myr. We attribute the efficient star formation to compressive gas motions in order to explain the modest velocity dispersions (⩽55 km s−1) of the photospheric lines and of the star-forming gas traced by [C I]. Because of the likely very young age of the radio source, our findings suggest that vigorous star formation consumes much of the gas and works in concert with the AGN to remove any residual molecular gas, and eventually quenching star formation in massive galaxies.