Medication delivery device comprising - a housing, - a cap configured to be attached to the housing, - locking means (16, 17) configured to lock the cap, wherein: in a first state the cap is detachable and in a second state the locking means (16, 17) locks the cap if the cap is attached; the medication delivery device is configured to contain a drug to be delivered; the medication delivery device is configured to deliver a multitude of doses of the drug, and, when the last dose has been delivered, the cap is locked if the cap is attached, and, when equal to or less than a predetermined amount of the drug is contained in the medication delivery device, the locking means (16, 17) locks the cap if the cap is attached; the medication delivery device further comprises a moveable element, wherein, if the cap is attached, the locking means (16, 17) locks the cap when the element is positioned in a given position, the given position being the position the element reaches when the last dose is delivered; characterized in that the housing comprises an aperture designed such that the locking means (16, 17) is pushed through the aperture, and in that the locking means is configured to protrude from the housing, when the element reaches the given position, wherein the cap comprises a mating means which is engageable with the locking means, and wherein, when the cap is attached, the protruding locking means is coupled with the mating means of the cap so that the cap is locked. - a housing, - a cap configured to be attached to the housing, - locking means (16, 17) configured to lock the cap, wherein: in a first state the cap is detachable and in a second state the locking means (16, 17) locks the cap if the cap is attached; the medication delivery device is configured to contain a drug to be delivered; the medication delivery device is configured to deliver a multitude of doses of the drug, and, when the last dose has been delivered, the cap is locked if the cap is attached, and, when equal to or less than a predetermined amount of the drug is contained in the medication delivery device, the locking means (16, 17) locks the cap if the cap is attached; the medication delivery device further comprises a moveable element, wherein, if the cap is attached, the locking means (16, 17) locks the cap when the element is positioned in a given position, the given position being the position the element reaches when the last dose is delivered; characterized in that the housing comprises an aperture designed such that the locking means (16, 17) is pushed through the aperture, and in that the locking means is configured to protrude from the housing, when the element reaches the given position, wherein the cap comprises a mating means which is engageable with the locking means, and wherein, when the cap is attached, the protruding locking means is coupled with the mating means of the cap so that the cap is locked. in a first state the cap is detachable and in a second state the locking means (16, 17) locks the cap if the cap is attached; the medication delivery device is configured to contain a drug to be delivered; the medication delivery device is configured to deliver a multitude of doses of the drug, and, when the last dose has been delivered, the cap is locked if the cap is attached, and, when equal to or less than a predetermined amount of the drug is contained in the medication delivery device, the locking means (16, 17) locks the cap if the cap is attached; the medication delivery device further comprises a moveable element, wherein, if the cap is attached, the locking means (16, 17) locks the cap when the element is positioned in a given position, the given position being the position the element reaches when the last dose is delivered; characterized in that the housing comprises an aperture designed such that the locking means (16, 17) is pushed through the aperture, and in that the locking means is configured to protrude from the housing, when the element reaches the given position, wherein the cap comprises a mating means which is engageable with the locking means, and wherein, when the cap is attached, the protruding locking means is coupled with the mating means of the cap so that the cap is locked.