We apply the axion-photon conversion mechanism to the 130 GeV $\gamma$-ray line observed by the Fermi satellite. Near the Galactic center, some astrophysical sources and/or particle dark matter can produce energetic axions (or axionlike particles), and the axions convert to $\gamma$ rays in Galactic magnetic fields along their flight to the Earth. Since continuum $\gamma$-ray and antiproton productions are sufficiently suppressed in axion production, the scenario fits the 130 GeV $\gamma$-ray line without conflicting with cosmic ray measurements. We derive the axion production cross section and the decay rate of dark matter to fit the $\gamma$-ray excess as functions of axion parameters. In the scenario, the $\gamma$-ray spatial distributions depend on both the dark matter profile and the magnetic field configuration, which will be tested by future $\gamma$-ray observations, e.g., H.E.S.S. II, CTA, and GAMMA-400. As an illustrative example, we study realistic supersymmetric axion models, and show the favored parameters that nicely fit the $\gamma$-ray excess.