Quake hits some seven kilometres southeast of the town of Plaza de Caisan near Costa Rica border at a depth of 37km.

At least five people have been injured after a magnitude 6.1 earthquake hit southwest Panama near the border with Costa Rica.

The earthquake was centred seven kilometres southeast of the town of Plaza de Caisan at a depth of 37km, according to the US Geological Survey.

The National Civil Protection System, or Sinaproc, said five people were hurt and four homes were damaged in the quake. Two of the damaged homes collapsed, Sinaproc added.

Images posted on social media showed simple wooden homes that partially collapsed in rural areas, deep fissures in tightly packed beach sand and entire grocery store shelves that spilled containers of processed food and bottled beverages on the floor.

“I was in the supermarket and everything swayed,” Carla Chavez told the Associated Press news agency by phone from David, the capital of Panama’s Chiriqui province near the quake’s epicentre. “Merchandise fell on the floor. Everything happened so fast.”

President Juan Carlos Varela said on Twitter earlier that just one person was hurt, in Puerto Armuelles, and also reported damage to homes and businesses.

Panama’s National Civil Protection Service said on Twitter that walls cracked at a hospital and two supermarkets in Changuinola in Bocas del Toro province.

There was no tsunami alert issued from the Pacific Tsunami Warning Center.

Sigifredo Perez, head of operations for Costa Rica’s National Commission of Emergencies, said no major damage or injuries had been reported in the country.