Objectives Whether unintended discontinuation of common, evidence-based, long-term medication occurs after hospitalisation; what factors are associated with unintended discontinuation; and whether the presence of documentation of medication at hospital discharge is associated with continuity of medication in general practice. Design Retrospective cohort study between 2012 and 2015. Setting Electronic records and hospital supplied discharge notifications in 44 Irish general practices. Participants 20 488 patients aged 65 years or more prescribed long-term medication for chronic conditions. Primary and secondary outcomes Discontinuity of four evidence-based medication drug classes: antithrombotic, lipid-lowering, thyroid replacement drugs and respiratory inhalers in hospitalised versus non-hospitalised patients; patient and health system factors associated with discontinuity; impact of the presence of medication in the hospital discharge summary on continuity of medication in a patient’s general practitioner (GP) prescribing record at 6months follow-up. Results In patients admitted to hospital, medication discontinuity ranged from 6%–11% in the 6months posthospitalisation. Discontinuity of medication is significantly lower for hospitalised patients taking respiratory inhalers (adjusted OR (AOR) 0.63, 95% CI (0.49 to 0.80), p<0.001) and thyroid medications (AOR 0.62, 95%CI (0.40 to 0.96), p=0.03). There is no association between discontinuity of medication and hospitalisation for antithrombotics (AOR 0.95, 95%CI (0.81 to 1.11), p=0.49) or lipid lowering medications (AOR 0.92, 95%CI (0.78 to 1.08), p=0.29). Older patients and those who paid to see their GP were more likely to experience increased odds of discontinuity in all four medicine groups. Less than half (39% to 47.4%) of patients had medication listed on their hospital discharge summary. Presence of medication on hospital discharge summary is significantly associated with continuity of medication in the GP prescribing record for lipid lowering medications (AOR 1.64, 95%CI (1.15 to 2.36), p=0.01) and respiratory inhalers (AOR 2.97, 95%CI (1.68 to 5.25), p<0.01). Conclusion Discontinuity of evidence-based long-term medication is common. Increasing age and private medical care are independently associated with a higher risk of medication discontinuity. Hospitalisation is not associated with discontinuity but less than half of hospitalised patients have medication recorded on their hospital discharge summary.