An internal combustion engine includes an electromagnetic actuator for operating
a gas exchange valve, this actuator being situated on a cylinder head. The actuator
includes a switchable electromagnet which is situated between two armatures. The
armatures are axially set apart on a common armature shaft. A cavity is configured
in the cylinder head, in which the actuator armature on the cylinder head side
is at least partially accommodated, and the electromagnet at least partially delimits
the cavity on the actuator side. This results in a compact internal combustion engine.