The lock cylinder has a housing (4) containing a rotatable core (1). There is an electronic evaluation unit (3) in the core for the coding of a key plus a device (5) to transmit the coding from the key to the unit. There is a power supply in the key or in the lock housing or core as well as an electromechanical lock mechanism working between the core and the housing. The lock mechanism has a bar (8) moving over the plane separating the core from the housing and a magnetic armature (17) with coil (18) which releases or blocks it. The bar can be pressed against a spring (16) in a recess in the housing.