  Context. Class 0 protostars represent the earliest evolutionary stage of
solar-type stars, during which the majority of the system mass resides in an
infalling envelope of gas and dust and is not yet in the central, nascent star.
Although X-rays are a key signature of magnetic activity in more evolved
protostars and young stars, whether such magnetic activity is present at the
Class 0 stage is still debated. Aims. We aim to detect a bona fide Class 0
protostar in X-rays. Methods. We observed HOPS 383 in 2017 December in X-rays
with the Chandra X-ray Observatory ($\sim$84 ks) and in near-infrared imaging
with the Southern Astrophysical Research telescope. Results. HOPS 383 was
detected in X-rays during a powerful flare. This hard (E > 2 keV) X-ray
counterpart was spatially coincident with the northwest 4 cm component of HOPS
383, which would be the base of the radio thermal jet launched by HOPS 383. The
flare duration was $\sim$3.3 h; at the peak, the X-ray luminosity reached
$\sim$4 x 1E31 erg s --1 in the 2-8 keV energy band, a level at least an order
of magnitude larger than that of the undetected quiescent emission from HOPS
383. The X-ray flare spectrum is highly absorbed (NH $\sim$ 7 x 1E23 cm --2),
and it displays a 6.4 keV emission line with an equivalent width of $\sim$1.1
keV, arising from neutral or low-ionization iron. Conclusions. The detection of
a powerful X-ray flare from HOPS 383 constitutes direct proof that magnetic
activity can be present at the earliest formative stages of solar-type stars.
