Electromagnetic actuators (10) are used, for example, to focus a lens in an endoscope (10). Actuators (10) of the generic type are very small. Even the smallest, manufacturing-related variations in the dimensioning of the permanent magnets (20, 21) of the actuator (10) have a negative effect on the field pattern of the magnets (20, 21) and thus on the switching behavior of the actuator (10). The invention creates an actuator (10) which can be switched particularly reliably. This is achieved by arranging the permanent magnets (20, 21) in such a way that a magnetic south pole (25) of the one permanent magnet (20, 21) faces a magnetic north pole (24) of the other permanent magnet (20, 21).