A magnitude 5.2 earthquake struck a coastal area of southern Peru, the US Geological Survey said. Residents reported light to moderate shaking after the offshore tremor.