A fastening element is proposed for fixing an attachment element on an extension piece of a syringe or a carpule, said extension piece having, on an 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 the ring element engages around the extension piece in a 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 first and second wall portions (15) and (17) are preferably connected to each other resiliently and enclose between them a free space (23), and wherein the first wall portion (15) is connected resiliently to the main body (3).