A polyaxial bone anchoring device comprising: a bone anchoring element having shank for anchoring to bone and a head, and a coupling assembly for coupling a rod to the bone anchoring element, the coupling assembly comprising: a receiving part having a first end, a second end, a central axis extending through the first end and second end, an accommodation space for accommodating the head of an anchoring element, the accommodation space having an opening at the second end sized so as to permit the insertion of the head and a bore extending from the accommodation space to the first end, and a recess for receiving a rod, a retainer element configured to be positioned at least partially in the accommodation space and being radially expandable and/or compressible so as to allow retaining the head which is inserted through the opening; wherein the retainer element is held in position adjacent the opening by a first engagement portion which engages an engagement structure provided at or in the accommodation space of the receiving part; a locking element, which is configured to be arranged at least partially in the accommodation space, the locking element being movable from a first position, in which the retainer element held in position adjacent the opening by the engagement structure is allowed to expand and release the inserted head, to a second position, in which radial expansion of the retainer element held in position adjacent the opening by the engagement structure is hindered so as to prevent release of the inserted head; wherein the retainer element further includes a second engagement portion for engagement by the locking element when moved in to the second position, such as to prevent the retainer element from expansion; wherein, when the locking element is in the second position, the head received in the accommodation space can be locked, wherein the locking element exerts a pressure force directly onto the head to press the head against the retainer element. a bone anchoring element having shank for anchoring to bone and a head, and a coupling assembly for coupling a rod to the bone anchoring element, the coupling assembly comprising: a receiving part having a first end, a second end, a central axis extending through the first end and second end, an accommodation space for accommodating the head of an anchoring element, the accommodation space having an opening at the second end sized so as to permit the insertion of the head and a bore extending from the accommodation space to the first end, and a recess for receiving a rod, a retainer element configured to be positioned at least partially in the accommodation space and being radially expandable and/or compressible so as to allow retaining the head which is inserted through the opening; wherein the retainer element is held in position adjacent the opening by a first engagement portion which engages an engagement structure provided at or in the accommodation space of the receiving part; a locking element, which is configured to be arranged at least partially in the accommodation space, the locking element being movable from a first position, in which the retainer element held in position adjacent the opening by the engagement structure is allowed to expand and release the inserted head, to a second position, in which radial expansion of the retainer element held in position adjacent the opening by the engagement structure is hindered so as to prevent release of the inserted head; wherein the retainer element further includes a second engagement portion for engagement by the locking element when moved in to the second position, such as to prevent the retainer element from expansion; wherein, when the locking element is in the second position, the head received in the accommodation space can be locked, wherein the locking element exerts a pressure force directly onto the head to press the head against the retainer element. a receiving part having a first end, a second end, a central axis extending through the first end and second end, an accommodation space for accommodating the head of an anchoring element, the accommodation space having an opening at the second end sized so as to permit the insertion of the head and a bore extending from the accommodation space to the first end, and a recess for receiving a rod, a retainer element configured to be positioned at least partially in the accommodation space and being radially expandable and/or compressible so as to allow retaining the head which is inserted through the opening; wherein the retainer element is held in position adjacent the opening by a first engagement portion which engages an engagement structure provided at or in the accommodation space of the receiving part; a locking element, which is configured to be arranged at least partially in the accommodation space, the locking element being movable from a first position, in which the retainer element held in position adjacent the opening by the engagement structure is allowed to expand and release the inserted head, to a second position, in which radial expansion of the retainer element held in position adjacent the opening by the engagement structure is hindered so as to prevent release of the inserted head; wherein the retainer element further includes a second engagement portion for engagement by the locking element when moved in to the second position, such as to prevent the retainer element from expansion; wherein, when the locking element is in the second position, the head received in the accommodation space can be locked, wherein the locking element exerts a pressure force directly onto the head to press the head against the retainer element.