A bone connection system for attaching a surgical robot having its base mounted in the vicinity of a patient, to a bone of the patient. The system incorporates a switchable bone connection unit attached between the bone and a support element of the robot. This unit has a locked state in which the bone is attached essentially rigidly to the support element, and a released state in which the bone can move relative to the support element. The unit comprises a force sensor for determining the force exerted between the bone and the support element of the robot, and a position sensor for measuring the position of the bone relative to the support element of said robot. The unit switches from its locked state to its released state when the force exceeds a predetermined level, selected to ensure that the bone can move without detaching any bone connection elements.