We present the discovery of TOI 540 b, a hot planet slightly smaller than Earth orbiting the low-mass star 2MASS J05051443-4756154. The planet has an orbital period of P=1.239149 days (± 170 ms) and a radius of r=0.903±0.052REarth, and is likely terrestrial based on the observed mass-radius distribution of small exoplanets at similar insolations. The star is 14.008 pc away and we estimate its mass and radius to be M=0.159±0.014MSun and R=0.1895±0.0079RSun, respectively. The star is distinctive in its very short rotational period of Prot=17.4264+/−0.0094 hours and correspondingly small Rossby number of 0.007 as well as its high X-ray-to-bolometric luminosity ratio of LX/Lbol=0.0028 based on a serendipitous XMM-Newton detection during a slew operation. This is consistent with the X-ray emission being observed at a maximum value of LX/Lbol≃10−3 as predicted for the most rapidly rotating M dwarfs. TOI 540 b may be an alluring target to study atmospheric erosion due to the strong stellar X-ray emission. It is also among the most accessible targets for transmission and emission spectroscopy and eclipse photometry with JWST, and may permit Doppler tomography with high-resolution spectroscopy during transit. This discovery is based on precise photometric data from TESS and ground-based follow-up observations by the MEarth team.