We show that on three--dimensional Riemannian manifolds without boundaries and with trivial first real de Rham cohomology group (and in no other dimensions) scalar field theory and Maxwell theory are equivalent: the ratio of the partition functions is given by the Ray--Singer torsion of the manifold. At the level of interaction with external currents, the equivalence persists provided there is a fixed relation between the charges and the currents.