An endoprosthesis for knee joint arthrodesis having a femur portion including a femur attachment structure; a tibia portion including a tibia attachment structure; a coupling section formed on the femur portion and a coupling section formed on the tibia portion. The coupling sections are pivotably connected to one another about a prosthesis pivot axis that extends in the installed position of the endoprosthesis horizontally from medial to lateral. A locking element is moveable between locking and release positions. In the locking position the locking element rigidly locks the coupling sections in a predefinable pivot position. In the release position the coupling sections are pivotable relative to one another about the prosthesis pivot axis. A retaining and return means and an unlocking mechanism are provided. The retaining means forces the locking element into the locking position. The unlocking mechanism moves the locking element into the release position.