A powerful earthquake struck southern Peru, sending residents rushing into the streets and triggering localized rockfalls in the mountainous Ayacucho region.