Aims/hypothesis We assessed secular trends of cardiovascular outcomes following first diagnosis of myocardial infarction (MI) or diabetes in an unselected population. Methods All Danish residents aged ≥30 years without prior diabetes or MI were identified by individual-level linkage of nationwide registers. Individuals hospitalised with MI or claiming a first-time prescription for a glucose-lowering medication (GLM) during the period from 1997 to 2006 were included. Analyses were by Poisson regression models. Primary endpoints were death by all causes, cardiovascular death and MI. Results The study included 3,092,580 individuals, of whom 77,147 had incident MI and 118,247 new-onset diabetes. MI patients had an increased short-term risk of all endpoints compared with the general population. The rate ratio (RR) for cardiovascular death within the first year after MI was 11.1 (95% CI 10.8-11.5) in men and 14.8 (14.3-15.3) in women, respectively. The risk rapidly declined and 1 year after the index MI, RR was 2.11 (2.00-2.23) and 2.8 (2.64-2.97) in men and women, respectively. Patients with diabetes carried a constantly elevated risk of all endpoints compared with the general population. The cardiovascular death RR was 1.90 (1.77-2.04) and 1.92 (1.78-2.07) in men and women, respectively during the first year after GLM initiation. Conclusions/interpretation Incident MI is associated with high short-term risk, which decreases rapidly over time. Incident diabetes is associated with a persistent excessive cardiovascular risk after initiation of GLM therapy. This further strengthens the necessity of early multi-factorial intervention in diabetes patients for long-term benefit.