To investigate the association between gestational age (GA) and grade point averages by domains of language and mathematics at the end of lower secondary education. A nationwide register-based study including all Danish children born in 1992-1997 who completed lower secondary education. Grades were evaluated by GA. Domain-specific differences in grades were investigated, and academic profiles were made. The study population comprised 319 796 children. For language, only minor differences in grades were observed. The grades in mathematics ranged from 7.02 (95% confidence interval [CI]: 7.00-7.04) at GA = 40 weeks to 5.86 (95% CI: 5.61-6.11) at GA <28 weeks. Grade differences showed lower grades in mathematics, compared to language, below GA 33-35 weeks. The academic profile of mathematical difficulties was more prevalent among GA <32 weeks. Average/high grades within both domains represented the predominant academic profile, constituting 68.8% at GA 39-41 weeks and 56.6% at GA <28 weeks. Only in mathematics decreasing GA was associated with lower grades. Increased mathematical difficulties were found below GA 33-35 weeks. The academic profile of mathematical difficulties was more prevalent among GA <32 weeks. However, the absolute differences in grades were small, and the predominant academic profile was average/high grades within both domains across all GA.