An electromagnetic locking element for locking a joint orthosis or joint prosthesis such as a knee orthosis or knee prosthesis. The electromagnetic locking element includes a bistable solenoid with at least one coil and at least one permanent magnet, a pin, which can be retracted and extended with the aid of the solenoid for locking the joint, one or several electrical energy stores such as capacitors, and an electrical control system, which, with the aid of semiconductor switches, discharges the energy store or stores via the at least one coil of the solenoid in such a way that the pin is extended.