  Jupiter co-orbital comets have orbits that are not long-term stable. They may
experience flybys with Jupiter close enough to trigger tidal disruptions like
the one suffered by comet Shoemaker-Levy 9. Our aim was to study the activity
and dynamical evolution of the Jupiter co-orbital comet P/2019 LD2 (ATLAS). We
present results of an observational study carried out with the 10.4m Gran
Telescopio Canarias (GTC) that includes image analyses using a MC dust tail
fitting code to characterize its activity, and spectroscopic studies to search
for gas emission. We also present N-body simulations to explore its orbital
evolution. Images of LD2 obtained on 2020 May 16 show a conspicuous coma and
tail. The spectrum does not exhibit any evidence of CN, C2, or C3 emission. The
comet brightness in a 2.6 arcsec aperture is r'=19.34+/-0.02 mag, with colors
(g'-r')=0.78+/-0.03, (r'-i')=0.31+/-0.03, and (i'-z')=0.26+/-0.03. The temporal
dependence of the dust loss rate can be parameterized by a Gaussian having a
FWHM of 350 days and a maximum of 60 kg/s reached on 2019 August 15. The total
dust loss rate is 1.9e09 kg. LD2 is now following what looks like a short arc
of a quasi-satellite cycle that started in 2017 and will end in 2028. On 2063
January 23, it will experience a very close encounter with Jupiter at 0.016 au.
Its probability of escaping the solar system during the next 0.5 Myr is
0.53+/-0.03. LD2 is a kilometer-sized object, in the size range of the
Jupiter-family comets, with a typical comet-like activity likely linked to
sublimation of crystalline water ice and clathrates. Its origin is still an
open question. We report a probability of LD2 having been captured from
interstellar space during the last 0.5 Myr of 0.49+/-0.02, 0.67+/-0.06 during
the last 1 Myr, 0.83+/-0.06 over 3 Myr, and 0.91+/-0.09 during the last 5 Myr.
