A polyaxial bone anchoring device includes a receiving part configured to be pivotably connected to a head of an anchoring element, the receiving part having a channel for receiving a rod, an accommodation space having an opening for accommodating the head, and a passage extending from a first end of the receiving part to the accommodation space, a cap member having a first portion configured to be positioned in the accommodation space and to hold the head, wherein the first portion is expandable in the accommodation space to allow insertion of the head and compressible to exert pressure on the head, and a sleeve-like insert piece including a spherical segment-shaped outer surface portion. The insert piece can be positioned at least partially around the first portion of the cap member and can pivot in the receiving part when the cap member and the insert piece are in the receiving part.