A magnitude 6.7 earthquake struck the Ayacucho region on Thursday, the US Geological Survey says.