The term and idea was first introduced initialized by Hermann Weyl when he was working on combining electromagnetism and general relativity to formulate Maxwell's equations in curved spacetime in 1918 and published as Gravity and electricity by Hermann Weyl (1918). Based on perception that symmetry implies charge conservation. The same idea was later adapted for quantum electrodynamics, a context in which is has even more impact.
Published on the session reports of the Royal Prussian Academy of Sciences at Berlin 1918 page 464.
Is about Maxwell's equations in curved spacetime, and notably introduces gauge theory.
Viewable for free at: archive.org/details/mobot31753002089727/page/464/mode/2up.