The interactions between electrons and lattice vibrations are fundamental to materials behaviour. In the case of group IV–VI, V and related materials, these interactions are strong, and the materials exist near electronic and structural phase transitions. The prototypical example is PbTe whose incipient ferroelectric behaviour has been recently associated with large phonon anharmonicity and thermoelectricity. Here we show that it is primarily electron-phonon coupling involving electron states near the band edges that leads to the ferroelectric instability in PbTe. Using a combination of nonequilibrium lattice dynamics measurements and first principles calculations, we find that photoexcitation reduces the Peierls-like electronic instability and reinforces the paraelectric state. This weakens the long-range forces along the cubic direction tied to resonant bonding and low lattice thermal conductivity. Our results demonstrate how free-electron-laser-based ultrafast X-ray scattering can be utilized to shed light on the microscopic mechanisms that determine materials properties.