We report a detailed analysis of γ-ray data of 2FGL J0509.9+1802 observed by the Large Area Telescope on board Fermi satellite, especially focusing on April 2013 when extraordinary γ-ray variability has been detected. Localization of γ-ray emission during this epoch suggests that the γ-ray source only associates with PKS 0507+17. The γ-ray emission of PKS 0507+17 is identified at the first time. The daily peak flux is over two orders of magnitude higher than the first two-year average flux, giving an isotropic γ-ray luminosity of ≃4×1048ergs-1. Rapid γ-ray variability with doubling time of 2–3h has been detected. Such a short doubling timescale has been detected for only a few bright blazars and indicates a location of γ-ray emission inside the broad line region. Together with the bluer-when-brighter γ-ray spectra, the variability phenomena could be well explained by the classic flat-spectrum radio quasar variability model that includes a fast injection of accelerated electrons and the external Compton cooling process.