We examine the relationship between the masslessness of a photon and the realization of global symmetries in abelian gauge theories in 2 + 1 dimensions: scalar and spinor QED and their immediate generalizations. We find that this masslessness (in the Coulomb phase) directly follows from the spontaneous breakdown of a symmetry generated by the magnetic flux. In spinor QED with two flavours the chiral symmetry is broken as well but a linear combination of the flux and chiral symmetries remains unbroken. A similar symmetry breaking pattern U(1) ⊗ U(1) → U(1) is realized also in Chern-Simons electrodynamics for a particular value of the Chern-Simons coefficient at which the photon becomes massless (anyon superconductor). The pertinent order parameter for the Higgs-Coulomb phase transition in scalar QED is identified with the vev of the magnetic vortex creation operator V(x). We calculate, using weak coupling perturbation theory, the vev and the correlator of V(x) in both phases. This turns out to be equivalent to evaluation of the euclidean QED partition function in the presence of the external current which produces a magnetic monopole (with the contribution of the Dirac string subtracted). In the Higgs phase this vev vanishes in accord with the Wigner-Weyl realization of the flux symmetry. In the Coulomb phase of scalar QED we obtain a nonzero value of the order parameter whereas in the spinor QED it vanishes. This indicates that in the scalar QED the symmetry breaking is of the usual Nambu-Goldstone type while in the spinor QED it is of Kosterlitz-Thouless type.