The JWST space telescope has the potential to measure the emission spectrum of a highly irradiated exoplanet as small as the Earth, especially if it transits a very nearby and cold star similar in size to Jupiter. Such ‘ultracool dwarf stars’ are frequent in the solar neighborhood, but their planetary population remain extremely poorly studied. Indeed, only one transiting planetary system had been discovered around an ultracool dwarf star so far, TRAPPIST-1, and none of its seven planets is irradiated enough to make spectroscopic characterization by occultation emission spectroscopy possible with JWST. Here we present the discovery by the SPECULOOS project of an Earth-sized planet on a 17 hr orbit around an M6.5-type dwarf star 16.8 parsecs away. Thanks to its large irradiation (∼16 times the Earth’s), the infrared brightness, and Jupiter-like size of its host star, emission spectroscopy is possible with JWST, enabling the study of the planet’s atmospheric composition and/or surface mineralogy