I will present the latest results obtained by the new UKIDSS Ultra Deep Survey (UDS). I will focus on the cosmological evolution of K-band selected galaxies, with particular emphasis devoted to the most massive sources and to the differential evolution of the populations of passive and star-forming galaxies. Furthermore, by exploiting the large area of the UDS field we investigate the properties of UV-selected galaxies at z~6, comparing the results with the latest predictions of the models of galaxy formation. Finally, I will briefly discuss our latest results on the evolution of dust-enshrouded massive galaxies obtained with the SHADES survey.