The authors minimally couple the electromagnetic field to gravity in Riemann-Cartan spacetimes using the self-consistent formalism for spinning fluids. The total Lagrangian is gauge invariant. The electromagnetic field equations, the spin transport equations and the symmetric stress-energy tensor are obtained.