We study the solar eruptive event on 2017 September 10 that produced long-lasting $>$100 MeV $gamma$-ray emission and a ground level enhancement (GLE72). The origin of the high-energy ions producing late-phase gamma-ray emission (LPGRE) is still an open question, but a possible explanation is proton acceleration at coronal shocks produced by coronal mass ejections. We examine a common shock acceleration origin for both the LPGRE and GLE72. The $gamma$-ray emission observed by the Fermi-Large Area Telescope exhibits a weak impulsive phase, consistent with that observed in hard X-and $gamma$-ray line flare emissions, and what appear to be two distinct stages of LPGRE. From a detailed modeling of the shock wave, we derive the 3D distribution and temporal evolution of the shock parameters, and we examine the shock wave magnetic connection with the visible solar disk. The evolution of shock parameters on field lines returning to the visible disk, mirrors the two stages of LPGRE. We find good agreement between the time history of $>$100 MeV $gamma$-rays and one produced by a basic shock acceleration model. The time history of shock parameters magnetically mapped to Earth agrees with the rates observed by the Fort Smith neutron monitor during the first hour of the GLE72 if we include a 30% contribution of flare-accelerated protons during the first 10 minutes, having a release time following the time history of nuclear $gamma$-rays. Our analysis provides compelling evidence for a common shock origin for protons producing the LPGRE and most of the particles observed in GLE72.