It is usually thought that the long-duration (>2 s) gamma-ray bursts (GRBs) are associated with massive star core collapse, however the short-duration (<2 s) GRBs are associated with mergers
of compact stellar binaries. In this work, we report the Fermi-LAT detection of gamma-ray
(> 100 MeV) afterglow emission from GRB 211211A, which is a nearby (350 Mpc) long-duration
GRB but discovered as a kilonova association. The gamma-ray emission from GRB 211211A
lasts ∼20,000 s after the burst, which suggests that it is the longest event for conventional short-
duration GRBs ever detected. We suggest that this gamma-ray emission results from afterglow
synchrotron emission. The soft spectrum of GeV emission may arise from a limited maximum
synchrotron energy of only a few hundreds of MeV at ∼20,000 s. The usually long duration of
the GeV emission could be due to the proximity of this GRB and the long deceleration time of
the GRB jet that is expanding in a low-density circumburst medium, consistent with the compact
stellar merger scenario.