An offshore earthquake of magnitude 6.9 has jolted a central Philippine province and collapsed the walls of houses and buildings, killing at least 31 people, authorities said.

The quake late Tuesday also injured scores of people and sent residents scrambling out of homes into darkness as the intense shaking cut off power.

The earthquake was centered about 17 kilometers northeast of Bogo, a coastal city of about 90,000 people in Cebu province.

Officials said at least 14 people were killed in the hard-hit city of Bogo, 12 in nearby Medellin and 5 in the town of San Remigio, south of Bogo, mostly after being hit by collapsing walls and houses.