Limited evidence exists on the level and longevity of protection afforded by current COVID-19 vaccines against infection and hospitalisation with the Omicron variant. SARS-CoV-2 PCR testing rates in Denmark are exceptionally high. In this nationwide cohort analysis, from December 28, 2021 to February 15, 2022 during which Omicron was the predominant variant, PCR testing data are combined with other national register data with near-complete information on all vaccinations, hospitalisations and comorbidities in the population. Trends over time in vaccine effectiveness after two and three doses with BNT162b2 (Pfizer-BioNTech) and mRNA-1273 (Moderna) are estimated using Cox regression. Despite relatively poor protection against infection (symptomatic or asymptomatic), vaccine effectiveness against COVID-19-associated hospitalisation was high after the third dose declining from 88.8% (95% CI: 87.3 to 90.1%) to 79.0% (76.5 to 81.3%) for BNT162b2 and 90.2% (87.3 to 92.5%) to 83.6% (77.7 to 88.0%) for mRNA-1273 over the first four months after vaccination.