Medication-overuse headache (MOH) is defined by the International Classification of Headache Disorders as a headache in patients with a pre-existing primary headache disorder that occurs on ≥15 days per month for >3 months, and is caused by overuse of medication intended for acute or symptomatic headache treatment. The prevalence of MOH in the general population is around 1%, but the condition is much more common in people with headache, in particular chronic migraine. The phenotype of the headache in MOH depends on the initial primary headache and the type of overused acute medication. In this Review, we will discuss the epidemiology, risk factors, pathophysiology, prevention and treatment of MOH. Treatment of MOH is performed in three steps: educating patients about the relationship between frequent intake of acute headache medication and MOH with the aim to reduce intake of acute medication; initiation of migraine prevention (such as topiramate or onabotulinumtoxin A in migraine) in patients who fail step 1; detoxification on an outpatient basis or in a day hospital or inpatient setting, depending on severity and comorbidities. The success rate of treatment is around 50-70%, although patients whose MOH is associated with opioid overuse have higher relapse rates. In all patients with MOH, relapse rates can be reduced by patient education and care in the follow-up period.