Magnetars are isolated neutron stars with exceptionally strong surface fields exceeding 1014 G (ref. 1). Their bright X-ray emission probes physical regimes in which quantum electrodynamics (QED) influences radiation propagation2–4. Strong magnetic fields induce polarization-dependent refractive indices in the vacuum5,6; such vacuum birefringence remains a long-standing but unconfirmed prediction of QED. Here we report phase- and energy-resolved polarization measurements of the radio-emitting magnetar 1E 1547.0−5408 obtained by coordinating X-ray and radio observations from the Imaging X-ray Polarimetry Explorer, the Neutron Star Interior Composition Explorer and the Parkes/Murriyang Observatory. We detect large polarization degrees (PDs) in the thermally dominant soft X-ray band, reaching phase-averaged values of 65% at 2 keV before substantially decreasing between 2 keV and 4 keV. At certain rotational phases, the 2–3 keV PD rises to nearly 80% while remaining high (≳40%) throughout the radio beam crossing. The phase-dependent X-ray and radio polarization angles are both consistent with the rotating vector model, suggesting that the emission geometries track the large-scale magnetic field of the star. Collectively, these characteristics challenge standard surface emission models using non-refractive propagation of light to infinity. Vacuum-birefringence-governed magnetospheric propagation can naturally explain the X-ray polarization signals. Our results represent a marked advance in probing this hallmark prediction of QED, opening a new cosmic window into superstrong-field quantum physics, thereby motivating further observational and theoretical studies concentrating on this domain.