A device for closing a delivery head of a dispensing machine for delivering fluid products, comprising: - a stationary support, - a drive shaft rotatable with respect to the stationary support around a vertical axis and movable with respect to the stationary support along said vertical axis, - a cup-shaped closing element carried at the distal end of an arm fixed to a lower end of the drive shaft, wherein the closing element has an open upper edge capable of engaging a lower edge of a delivery head, - a screw and nut mechanism (30, 50) including a screw fixed to the drive shaft and a nut rotationally fixed with respect to the stationary support and movable with respect to the stationary support along said vertical axis, and - a cam carried by the stationary support and cooperating with a cam-follower carried by the drive shaft, wherein said cam has a first cam portion and a second cam portion (48"), wherein when the cam-follower engages the first cam portion, the drive shaft is rotationally bound to the stationary support, and is free to move along the vertical axis, and wherein when the cam-follower engages the second cam portion, the drive shaft is axially bound to the stationary support, and is free to rotate around the vertical axis, in such a way that a vertical stroke of the nut along the vertical axis between a raised position and a lowered position controls - in succession - a translation of the drive shaft along the vertical axis and a rotation of the drive shaft around the vertical axis, and wherein a translation of the nut from the lowered position to the raised position controls - in succession - a rotation of the drive shaft around the vertical axis and a translation of the drive shaft along the vertical axis. - a stationary support, - a drive shaft rotatable with respect to the stationary support around a vertical axis and movable with respect to the stationary support along said vertical axis, - a cup-shaped closing element carried at the distal end of an arm fixed to a lower end of the drive shaft, wherein the closing element has an open upper edge capable of engaging a lower edge of a delivery head, - a screw and nut mechanism (30, 50) including a screw fixed to the drive shaft and a nut rotationally fixed with respect to the stationary support and movable with respect to the stationary support along said vertical axis, and - a cam carried by the stationary support and cooperating with a cam-follower carried by the drive shaft, wherein said cam has a first cam portion and a second cam portion (48"), wherein when the cam-follower engages the first cam portion, the drive shaft is rotationally bound to the stationary support, and is free to move along the vertical axis, and wherein when the cam-follower engages the second cam portion, the drive shaft is axially bound to the stationary support, and is free to rotate around the vertical axis, in such a way that a vertical stroke of the nut along the vertical axis between a raised position and a lowered position controls - in succession - a translation of the drive shaft along the vertical axis and a rotation of the drive shaft around the vertical axis, and wherein a translation of the nut from the lowered position to the raised position controls - in succession - a rotation of the drive shaft around the vertical axis and a translation of the drive shaft along the vertical axis.