A locking mechanism for a quick connect coupling having a locking sleeve, the locking sleeve is axially displaceable for locking the quick connect coupling in a locked position and for unlocking the quick connect coupling in an unlocked position; the locking mechanism comprising a safety ring, the safety ring is axially displaceable for engaging the locking sleeve and the safety ring being partly inside or partly outside the locking sleeve, the safety ring being positionable in three different axial positions, a first axial position for allowing the locking sleeve to be in the unlocked position, a second axial position for allowing the safety ring to rotate, a third axial position for allowing the locking sleeve to be in the locked position; a spring, the spring acting between the locking sleeve and the safety ring, the spring comprising a spring force forcing the locking sleeve and the safety ring away from each other; and a track and a locking element, the locking element being relatively movable in the track; characterised in that the track comprises two grooves (401, 402) in the axial direction connected at each one of their ends with a third groove in the circumferential direction; and wherein the first groove in the axial direction has a length corresponding to the first axial position for allowing the locking sleeve to be in the unlocked position, the second groove in the axial direction has a first end point corresponding to the third axial position, and the third groove has a second end point corresponding to the second axial position for allowing the safety ring to rotate. the locking mechanism comprising a safety ring, the safety ring is axially displaceable for engaging the locking sleeve and the safety ring being partly inside or partly outside the locking sleeve, the safety ring being positionable in three different axial positions, a first axial position for allowing the locking sleeve to be in the unlocked position, a second axial position for allowing the safety ring to rotate, a third axial position for allowing the locking sleeve to be in the locked position; a first axial position for allowing the locking sleeve to be in the unlocked position, a second axial position for allowing the safety ring to rotate, a third axial position for allowing the locking sleeve to be in the locked position; a spring, the spring acting between the locking sleeve and the safety ring, the spring comprising a spring force forcing the locking sleeve and the safety ring away from each other; and a track and a locking element, the locking element being relatively movable in the track; characterised in that the track comprises two grooves (401, 402) in the axial direction connected at each one of their ends with a third groove in the circumferential direction; and wherein the first groove in the axial direction has a length corresponding to the first axial position for allowing the locking sleeve to be in the unlocked position, the second groove in the axial direction has a first end point corresponding to the third axial position, and the third groove has a second end point corresponding to the second axial position for allowing the safety ring to rotate.