A locking device (30) for preventing a rotating motion of a shaft (14) in relation to a housing (16) of a transmission/drive unit (10), having a first locking element (32) and a second locking element (34) that an electromagnet (44) and at least one return element (42) are able to move axially in relation to the first locking element (32) in order to produce a rotationally fixed connection between the first and second locking elements (32, 34), wherein the electromagnet (44) has an inner pole (47) that is encompassed by an electric coil (45), which inner pole (47) has an axial extension (51) that extends into a corresponding opening (64) of the second locking element (34) in order to produce an axial guidance and centering, and
- wherein the second locking element (34) has axial holes (81) into which axial guide pins (79), formed onto an axial side (87) of the electromagnet (44), extend, the guide pins taper in an axial direction (15) towards the second locking element (34) in order to axially guide the second locking element (34), and the guide pins (79) are conically embodied at a cone angle (77) determined so that there is enough play for gear teeth of an axial form-locked engagement (85) of the two locking elements (32, 34) to find each other during the closing process of the locking device.