  Previously unremarkable, the extragalactic radio source GB 1310+487 showed a
gamma-ray flare on 2009 November 18, reaching a daily flux of ~10^-6
photons/cm^2/s at energies E>100 MeV and becoming one of the brightest GeV
sources for about two weeks. Its optical spectrum is not typical for a blazar,
instead, it resembles those of narrow emission-line galaxies. We investigate
changes of the object's radio-to-GeV spectral energy distribution (SED) during
and after the prominent GeV flare with the aim to determine the nature of the
object and constrain the origin of the variable high-energy emission. The data
collected by the Fermi and AGILE satellites at gamma-ray energies, Swift at
X-ray and ultraviolet, Kanata, NOT, and Keck telescopes at optical, OAGH and
WISE at infrared, and IRAM 30m, OVRO 40m, Effelsberg 100m, RATAN-600, and VLBA
at radio, are analysed together to trace the SED evolution on timescales of
months. The gamma-ray/radio-loud narrow-line active galactic nucleus (AGN) is
located at redshift z=0.638. It is shining through an unrelated foreground
galaxy at z=0.500. The AGN light is likely amplified by a factor of a few
because of gravitational lensing. The AGN SED shows a two-humped structure
typical of blazars and gamma-ray-loud NLSy1 galaxies, with the high-energy
(inverse-Compton) emission dominating by more than an order of magnitude over
the low-energy (synchrotron) emission during gamma-ray flares. The difference
between the two SED humps is smaller during the low-activity state. Fermi
observations reveal a strong correlation between the gamma-ray flux and
spectral index, with the hardest spectrum observed during the brightest
gamma-ray state. If the gamma-ray flux is a mixture of synchrotron self-Compton
(SSC) and external Compton (EC) emission, the observed GeV spectral variability
may result from varying relative contributions of these two emission
components.
