  We study the possibility that an extended cosmic-ray leptonic and/or hadronic
halo is at the origin of the large-scale gamma-ray emission detected from the
Andromeda Galaxy (M31). We consider a broad ensemble of non-homogeneous
diffusion scenarios and of cosmic-ray injection sources. We find that
cosmic-ray electrons and protons could be, and very likely are, responsible for
part, or all, of the gamma-ray emission from M31, including out to more than
100 kpc from the center of the galaxy. We also simulate possible emission from
pulsars in M31, and consider the effect of regions of highly inefficient
diffusion around cosmic-ray acceleration sites, as suggested by recent TeV halo
observations with Cherenkov telescopes.
