A medicament delivery device is presented having an elongated housing extending in a longitudinal direction, which housing is arranged to accommodate a medicament container, an end cap arranged with a first attachment element designed to engage with a second attachment element on the housing for attaching the end cap to the housing, a rotator rotatably arranged inside the housing, an activator axially slidable with respect to the housing from an extended position to a retracted position and operably connected to the rotator such as to rotate the rotator from an initial non-activated rotational position and an activated rotational position when the activator is moved from the extended to the retracted position. The rotator further comprises a blocking element arranged to cooperate with the first attachment element for preventing disengagement of the first attachment element from the second attachment element when the rotator is in the activated rotational position.