We address the fundamental question of matching the rest-frame K-band luminosity function (LF) of galaxies over the Hubble time using semi-analytic models after modification of the stellar population modelling. We include the Maraston evolutionary synthesis models, which feature a higher contribution by the thermally pulsating asymptotic giant branch (TP-AGB) stellar phase, into three different semi-analytic models, namely the De Lucia and Blaizot version of the Munich model, morgana and the Menci model. We leave all other input physics and parameters unchanged. We find that the modification of the stellar population emission can solve the mismatch between models and the observed rest-frame K-band luminosity from the brightest galaxies derived from UKIRT Infrared Deep Sky Survey data at high redshift. For all explored semi-analytic models, this holds at the redshifts – between 2 and 3 – where the discrepancy was recently pointed out. The reason for the success is that at these cosmic epochs the model galaxies have the right age (∼1 Gyr) to contain a well-developed TP-AGB phase, which makes them redder without the need of changing their mass or age. We have also computed a version of the Munich model using the Charlot and Bruzual models that adopt the Marigo TP-AGB prescription and find the same result as that with the Maraston models. At the same time, the known overestimation of the faint end is enhanced in the K band when including the TP-AGB contribution. At lower redshifts (z < 2) some of the explored models deviate from the data. This is due to short merging time-scales and inefficient ‘radio-mode’ active galactic nucleus feedback. Our results show that a strong evolution in mass predicted by hierarchical models is compatible with no evolution on the bright end of the K-band LF from z= 3 to the local universe. This means that, at high redshifts and contrary to what is commonly accepted, K-band emission is not necessarily a good tracer of galaxy mass.