The 5.9-magnitude quake struck the southern city of Surigao and surrounding areas, causing some walls to collapse, government seismologists and civil defence officers said.