We observed the young (∼ 1700 yrs) pulsar PSR B0540−69 in the near-ultraviolet (UV) for the first time with the Space Telescope Imaging Spectrograph (STIS) aboard the Hubble Space Telescope. Imaging observations with the NUV-and FUV-MAMA detectors in TIME-TAG mode allowed us to clearly detect the pulsar in two bands around 2350Å and 1590Å, with magnitudes m NUV = 21.45±0.02 and m FUV = 21.83±0.10. We also detected the pulsar-wind nebula (PWN) in the NUV-MAMA image, with a morphology similar to that observed in the optical and near-infrared (IR). The extinctioncorrected NUV and FUV pulsar fluxes are compatible with a very steep power law spectrum F ν ∝ ν −α with spectral index α UV ∼ 3, non compatible with a Rayleigh Jeans spectrum, indicating a nonthermal origin of the emission. The comparison with the optical/near-IR power-law spectrum (spectral index α O,nIR ∼ 0.7), indicates an abrupt turnover at wavelengths below 2500Å, not yet observed in other pulsars. We detected pulsations in both the NUV and FUV data at the 50 ms pulsar period. In both cases, the folded light curve features a broad pulse with two peaks closely spaced in phase, as observed in the optical and X-ray light curves. The NUV/FUV peaks are also aligned in phase with those observed in the radio (1.4 GHz), optical, X, and γ-ray light curves, like in the Crab pulsar, implying a similar beaming geometry across all wavelengths. PSR B0540−69 is now the fifth isolated pulsar, together with Crab, Vela, PSR B0656+14, and the radio-quiet Geminga, detected in the optical, near-UV, near-IR, X-rays and γ-rays, and seen to pulsate in at least four of these energy bands. Subject headings: (stars:) pulsars: individual (PSR B0540−69)