There were no immediate reports of injury or damage from the quake, which was felt as far away as the capital, Lima, Reuters reported.
The quake struck at a depth of more than 100 km (60 miles), limiting the shaking level.
The Euro-Mediterranean Seismological Centre said in a tweet the quake occurred in a very sparsely populated region of the Amazon rainforest.
The US Tsunami Warning System said there was no tsunami warning after the quake.
ZZ/PR