Background End of life(EoL) care becomes more complex and increasingly takes place in the community, but there is little data on the use of general practice(GP) services to guide care improvement. This study aims to determine the trends and factors associated with GP consultation, prescribing and referral to other care services amongst cancer patients in the last year of life. Methods A retrospective cohort study of cancer patients who died in 2000-2014, based on routinely collected primary care data(the Clinical Practice Research DataLink, CPRD) covering a representative sample of the population in the United Kingdom. Outcome variables were number of GP consultations(primary), number of prescriptions and referral to other care services(yes vs no) in the last year of life. Explanatory variables included socio-demographics, clinical characteristics and the status of palliative care needs recognised or not. The association between outcome and explanatory variables were evaluated using multiple-adjusted risk ratio(aRR). Results Of 68,523 terminal cancer patients, 70% were aged 70+, 75% had comorbidities and 45.5% had palliative care needs recognised. In the last year of life, a typical cancer patient had 43 GP consultations(Standard deviation(SD): 31.7; total=3,031,734), 71.5 prescriptions(SD: 68.0; total=5,074,178), and 21(SD: 13.0) different drugs; 58.0% of patients had at least one referral covering all main clinical specialities. More comorbid conditions, prostate cancer and having palliative care needs recognised were associated with more primary care consultations, more prescriptions and a higher chance of referral(aRRs 1.07-2.03). Increasing age was related to fewer consultations(aRRs 0.77-0.96), less prescriptions(aRR 1.09-1.44), and a higher chance of referral(aRRs 1.08-1.16) but less likely to have palliative care needs recognised(aRRs 0.53-0.89). Conclusions GPs are very involved in end of life care of cancer patients, most of whom having complex care needs, i.e. older age, comorbidity and polypharmacy. This highlights the importance of enhancing primary palliative care skills among GPs and the imperative of greater integration of primary care with other healthcare professionals including oncologists, palliative care specialists, geriatricians and pharmacists. Research into the potential of deprescribing is warranted. Older patients have poorer access to both primary care and palliative care need to be addressed in future practices.