We report the discovery of a flaring X-ray source in the globular cluster NGC 6540, obtained during the EXTraS project devoted to a systematic search for variability in archival data of the XMM-Newton satellite. The source had a quiescent X-ray luminosity of the order of ~10^32 erg/s in the 0.5-10 keV range (for a distance of NGC 6540 of 4 kpc) and showed a flare lasting about 300 s. During the flare, the X-ray luminosity increased by more than a factor 40, with a total emitted energy of ~10^36 erg. These properties, as well as Hubble Space Telescope photometry of the possible optical counterparts, suggest the identification with a chromospherically active binary. However, the flare luminosity is significantly higher than what commonly observed in stellar flares of such a short duration, leaving open the possibility of other interpretations.