A 5.8 magnitude earthquake struck central Peru on Monday, shaking buildings in Lima, the capital, but there was no immediate damage or casualties reported.