A rod-shaped implant element is provided for connecting at least two bone anchoring elements. Each bone anchoring element includes an anchoring section to be anchored in the bone and a receiver member to be connected to the rod-shaped implant element. The rod-shaped implant element includes, a longitudinal axis, at least one first length of a rigid section that is configured to cooperate with and be received in the receiver member, a second length of a flexible section adjacent to the rigid section, a bore coaxial to the longitudinal axis and extending through the rigid section and the flexible section, and a core accommodated in the bore, the core having two opposite ends. At least one end of the core is freely movable in the bore when said flexible section is extended or compressed in a direction of the longitudinal axis.