The invention relates to a join mechanism of a knee orthosis or knee prosthesis, having a first part (14), a second part (15), which is pivotable relative to the latter, and attachment means (2) for securing the joint mechanism (1) to a user of the knee orthosis or knee prosthesis, and having a locking mechanism (4, 40) with which a pivoting of the two parts (14, 15) relative to each other in a flexion direction is prevented by a form-fit element (4) which is arranged movably on the second part (15) and which, in the locking state, engages with a form fit in a recess (40) assigned to the first part (14), wherein the form-fit element (4) is mounted rotatably on the second part (15) and has a contour which, in the locked position, protrudes into the recess (40) and, in the released position, allows the first part (14) to pivot past the bearing of the form-fit element (4).