Side rail (2) of bed (1) comprising two side bars (5) fitted with a rotational bearing (4) at the bottom end for attachment to the frame of the bed (1), where the side bars (5) are connected by a top bar (6) at the top end to form a parallelogram. A locking mechanism (3) is located between one of the side bars (5) and the top bar (6) comprising a first member (11) firmly fixed to the side bar (5) and second member (12) firmly fixed to the top bar (6), where these members have a common axis (10) of rotation. One member comprises two notches (16, 17) and the second member a stop (13) to restrict the mutual rotational movement of the members. A latch (9) to keep the side rail (2) in the locked position is connected to the locking mechanism (3). In an alternative design, the cover member (12) can be connected to the side bar (5) and rotational member (11) on the top bar (6), and the locking mechanism adapted accordingly.