The psychological consequences of losing a parent to cancer are unclear. We investigated whether experiencing parental death to cancer before 18 years of age increases the risk of psychotropic medication. We used register data of all children born in Denmark between 1 January 1987 and 31 December 2016 (N = 1,488,846). We assessed rate ratios (RRs) with 95% confidence intervals (CIs) for first redeemed prescription of antidepressants, anxiolytics and hypnotics according to parental death status using Poisson multi-state models. We further examined whether the associations differed according to the gender of the deceased parent, child's age at the time of death or the parental length of illness. Cancer-bereaved children had a significantly increased risk of first prescription of psychotropic medication (rate ratio, RR 1.22, 95% confidence interval, CI 1.10-1.34 for males; RR 1.18, 95% CI 1.09-1.28 for females). Associations were strongest if the parent had the same sex as the child and if the parent died within one year of diagnosis. The risk was highest during the first six months after the loss (RR 2.35, 95% confidence interval, CI 1.48-3.73 for males; RR 1.81, 95% CI 1.17-2.80 for females). Children who lose a parent to cancer, particularly in cases when the disease progressed quickly, may need extra psychological support, especially during the first six months after the death.