We present the first detection of an X-ray flare from an ultracool dwarf of spectral class L. The event was identified in the EXTraS database of XMM-Newton variable sources, and its optical counterpart, J0331-27, was found through a cross-match with the Dark Energy Survey Year 3 release. Next to an earlier four-photon detection of Kelu-1, J0331-27 is only the second L dwarf detected in X-rays, and much more distant than other ultracool dwarfs with X-ray detections (photometric distance of 240 pc). From an optical spectrum with the VIMOS instrument at the VLT, we determine the spectral type of J0331-27 to be L1. The X-ray flare has an energy of E X,F ∼ 2 × 10 33 erg, placing it in the regime of superflares. No quiescent emission is detected, and from 2.5 Msec of XMM-Newton data we derive an upper limit of L x,qui < 10 27 erg/s. The flare peak luminosity (L x,peak = 6.3 × 10 29 erg/s), flare duration (τ decay ≈ 2400 s), and plasma temperature (≈ 16 MK) are similar to values observed in X-ray flares of M dwarfs. This shows that strong magnetic reconnection events and the ensuing plasma heating are still present even in objects with photospheres as cool as ∼ 2100 K. However, the absence of any other flares above the detection threshold of E X,F ∼ 2.5 × 10 32 erg in a total of ∼ 2.5 Ms of X-ray data yields a flare energy number distribution inconsistent with the canonical power law dN/dE ∼ E −2 , suggesting that magnetic energy release in J0331-27 -and possibly in all L dwarfs -takes place predominantly in the form of giant flares.