About 1 out of 200 Sun-like stars has a planet with an orbital period shorter than one day: an ultrashort-period planet1,2. All of the previously known ultrashort-period planets are either hot Jupiters, with sizes above 10 Earth radii (R⊕), or apparently rocky planets smaller than 2 R⊕. Such lack of planets of intermediate size (the `hot Neptune desert') has been interpreted as the inability of low-mass planets to retain any hydrogen/helium (H/He) envelope in the face of strong stellar irradiation. Here we report the discovery of an ultrashort-period planet with a radius of 4.6 R⊕ and a mass of 29 M⊕, firmly in the hot Neptune desert. Data from the Transiting Exoplanet Survey Satellite3 revealed transits of the bright Sun-like star LTT 9779 every 0.79 days. The planet's mean density is similar to that of Neptune, and according to thermal evolution models, it has a H/He-rich envelope constituting 9.0-2.9+2.7?% of the total mass. With an equilibrium temperature around 2,000 K, it is unclear how this `ultrahot Neptune' managed to retain such an envelope. Follow-up observations of the planet's atmosphere to better understand its origin and physical nature will be facilitated by the star's brightness (Vmag = 9.8).