Many physical systems including lattices near structural phase transitions, glasses, jammed solids and biopolymer gels have coordination numbers placing them at the edge of mechanical instability. Their properties are determined by an interplay between soft mechanical modes and thermal fluctuations. Here we report our investigation of the mechanical instability in a lattice model at finite temperature T. The model we used is a square lattice with a Ø4 potential between next-nearest-neighbour sites, whose quadratic coefficient κ can be tuned from positive to negative. Using analytical techniques and simulations, we obtain a phase diagram characterizing a first-order transition between the square and the rhombic phase and different regimes of elasticity, as well as an ‘order-by-disorder’ effect that favours the rhombic over other zigzagging configurations. We expect our study to provide a framework for the investigation of finite-T mechanical and phase behaviour of other systems with a large number of floppy modes.