Building panels provided with a mechanical locking system including a tongue, at an edge of a first panel, cooperating with a tongue groove, at an edge of an adjacent second panel, for vertical locking of the building panels. The edge of the first panel is provided with a displacement groove, which is downwardly open, and includes an inner wall, an outer wall, and an upper wall. The tongue is formed out of the edge of the first panel. A resilient and displaceable and part of the tongue is displaceable into the displacement groove.