The quake hit 8 kilometers (5 miles) west of Atiquipa, about 600 kilometers (372 miles) south of the capital Lima.
Some residents of Atiquipa said on social media they felt a very strong and long quake that caused their beds to shake.
CCTV footage from the nearby town of Caraveli shows a residential street as the tremor shakes violently and people come out of their houses.
The quake was felt as far as the capital. Video posted to social media shows lamps swaying inside houses in Lima.
Eight people have been injured in the incident, according to authorities. Of those, five received medical attention in two hospitals in the Ica region and three were treated for minor injuries at a hospital in the neighboring Arequipa region, both in southwestern Peru, the ministry of health said Friday morning.