Electromagnetic locking device, comprising a main part intended to be secured to a first element such as a casing or an opening leaf, a movable part with a longitudinal rod provided with a retaining recess and intended to be secured to a second element to be locked and released selectively with respect to the first element, and electromagnetic retaining means ensuring the selective retention of the movable part on the main part against its movement away from the main part, in which: - the main part comprises mechanical retaining means which can be moved between a retaining position and a release position in order to selectively retain in a reception housing or release, along a longitudinal engagement axis (I-I), the longitudinal rod provided with the retaining recess, - the mechanical retaining means comprise a retaining element (9a, 9b) comprising a first free end provided with a locking nose shaped and dimensioned so as to be able to be engaged, in the retaining position, in the retaining recess of the longitudinal rod, - the main part comprises unlockable locking means which are provided with a locking surface and can be moved in a first direction (II-II) parallel to the longitudinal engagement axis (I-I) between a locking position in which the locking surface prevents the movement of the mechanical retaining means away from their retaining position, and an unlocking position in which the locking surface is away from the mechanical retaining means and allows them to move into the release position, - the locking means are selectively retained or released, in their movement in the first direction (II-II), by the electromagnetic retaining means, - the retaining recess is an outer annular groove, characterized in that: - the mechanical retaining means are slideably mounted in a second direction (III-III), - said at least one retaining element (9a, 9b) comprises a locking nose with an inclined planar supporting face perpendicular to the plane defined by the second direction (III-III) and by the longitudinal engagement axis (I-I), - the locking nose and the retaining recess are shaped so as to come into contact with one another with only a linear bearing support which develops in a third direction (IV-IV) contained in the plane defined by the second direction (III-III) and by the longitudinal engagement axis (I-I). - the main part comprises mechanical retaining means which can be moved between a retaining position and a release position in order to selectively retain in a reception housing or release, along a longitudinal engagement axis (I-I), the longitudinal rod provided with the retaining recess, - the mechanical retaining means comprise a retaining element (9a, 9b) comprising a first free end provided with a locking nose shaped and dimensioned so as to be able to be engaged, in the retaining position, in the retaining recess of the longitudinal rod, - the main part comprises unlockable locking means which are provided with a locking surface and can be moved in a first direction (II-II) parallel to the longitudinal engagement axis (I-I) between a locking position in which the locking surface prevents the movement of the mechanical retaining means away from their retaining position, and an unlocking position in which the locking surface is away from the mechanical retaining means and allows them to move into the release position, - the locking means are selectively retained or released, in their movement in the first direction (II-II), by the electromagnetic retaining means, - the retaining recess is an outer annular groove, - the mechanical retaining means are slideably mounted in a second direction (III-III), - said at least one retaining element (9a, 9b) comprises a locking nose with an inclined planar supporting face perpendicular to the plane defined by the second direction (III-III) and by the longitudinal engagement axis (I-I), - the locking nose and the retaining recess are shaped so as to come into contact with one another with only a linear bearing support which develops in a third direction (IV-IV) contained in the plane defined by the second direction (III-III) and by the longitudinal engagement axis (I-I).