A fastening element is proposed for fixing an attachment element on the extension piece of a syringe or carpule, said extension piece having, on its outer face, at least one projection, wherein the fastening element (1) has an annular main body (3) on which a ring element (13) is articulated such that it engages around the extension piece in the mounted state. The ring element has an annular first wall portion (15), which is articulated on the main body (3) via a first bearing area (19), and has an annular second wall portion (17), which is articulated on the first wall portion (15) via a second bearing area (21), wherein the two wall areas (15) and (17) are preferably connected to each other resiliently and enclose between them a free space (23), and wherein the first wall area (15) is connected resiliently to the main body (3).