(1) Background: Among the chronic complications of type 2 diabetes mellitus, cancer has become the leading cause of death in several countries. Our objective was to determine whether prevalent type 2 diabetes mellitus is associated with a higher incidence of cancer. (2) Methods: This study comprised a nationwide analysis conducted in Hungary. The study population was divided into two groups: a type 2 diabetes mellitus group vs. a non-diabetic group. The primary outcome was the risk related to overall cancer incidence; a key secondary outcome was the overall incidence of cancer in distinct study years; and a further outcome was the annual percent changes. (3) Results: The odds ratio related to the overall incidence of cancer was 2.50 (95% confidence interval: 2.46–2.55, p < 0.0001) in patients with diabetes as related to non-diabetic controls. The odds ratio was higher in males than in females [ORmales: 2.76 (2.70–2.82) vs. ORfemales: 2.27 (2.22–2.33), p < 0.05 for male-to-female comparison]. The annual cancer incidence rate declined in non-diabetic controls, but not in patients with diabetes [−1.79% (−2.07–−1.52%), p < 0.0001] vs. −0.50% (−1.12–+0.10%), p = 0.0991]. Several types of cancer showed a decreasing tendency in non-diabetic controls, but not in patients with type 2 diabetes. (4) Conclusions: Type 2 diabetes is associated with a higher risk of cancer. While the cancer incidence decreased for non-diabetic individuals with time, it remained unchanged in patients with T2DM.