Observations of the high degree of isotropy of the cosmic microwave backgro
und are commonly believed to indicate that the Universe is 'almost' Friedma
nn-Lemaitre-Robertson-Walker (at least since the time of last scattering).
Theoretical support for this belief comes from the so-called Ehlers-Geren-S
achs theorem. We show that a generalization of this theorem rules out any s
trong magnetic fields in the Universe. Our theoretical result is model-inde
pendent and includes the case of inhomogeneous magnetic fields, complementi
ng previous results. We thus prove that cosmic microwave background observa
tions severely constrain all types of primordial and protogalactic magnetic
fields in the universe.