An earthquake with a magnitude as high as 8.0 stuck northern Peru in the early hours of Sunday morning, the United States Geological Survey reported.