Medical lines from containers of medicine need secure closures to prevent inadvertent leakage and subsequent contamination. Prior art closures and safety caps involve risks of accidental opening or disengagement particularly due to incorrect use by operators. With this in mind, a cap for medical fluid lines and the like is provided, characterized in that it comprises a hollow body (1) within which a male or female connector (2; 3) accessible at one end of the body (1) is coaxially housed, and is configured so as to inviolably obstruct the passage through said body (1). A unidirectional coupling (12, 13) is provided to lock in rotation the connector (2; 3) with respect to the body (1) in the direction (F) corresponding to the screwing of the connector (2; 3) and a complementary connector to be coupled therewith, and to enable free rotation of the connector (2; 3) in the opposite direction. The connector (2; 3) can be possibly locked in rotation with respect to the body (1) in the unscrewing direction, only following a positive command. (Figure 2)