Two strong aftershocks collapsed homes and cracked walls in Puerto Rico on Friday as the Caribbean island tried to recover from its worst earthquake in more than a century.

The first quake of magnitude 5.2 struck at 6:26 p.m., followed by another of magnitude 4.8 about four hours later, both centered on the island's southwest coast, the U.S. Geological Service (USGS) said.

The quakes were felt as far north as the capital, San Juan, and a spokesman for the town of Guayanilla told the El Nuevo Dia newspaper they caused more homes and buildings to collapse in the hard-hit community.