Benin's president has appeared on television to reassure citizens of the West African nation that the situation was now totally under control following an attempted coup earlier in the day.

I would like to commend the sense of duty demonstrated by our army and its leaders, who have remained... loyal to the nation, Patrice Talon said, looking calm during the live evening broadcast.

The government said it had thwarted the mutiny hours after a group of soldiers declared a takeover on national television.

Later in the afternoon, huge explosions were heard in Cotonou, Benin's largest city and seat of government. They were thought to have been the result of an air strike.

Prior to the explosions, flight-tracking data showed that three aircraft had entered Benin's airspace from neighbouring Nigeria before returning home.

A spokesman for Nigeria's president later confirmed that its fighter jets had gone in to take over the airspace to help dislodge the coup plotters from the national TV and a military camp where they had regrouped.

There have been a series of coups in West Africa before Sunday's thwarted attempt in Benin, heightening fears that the security of the region could worsen.

Benin, a former French colony, has been regarded as one of Africa's more stable democracies. But Talon has faced accusations of suppressing criticism of his policies.

The nation is one of the continent's largest cotton producers, but ranks among the world's poorest countries.

Nigeria, Benin's large neighbour to the east, has described the coup attempt as a direct assault on democracy.

The 67-year-old president said in his address that loyalist forces had cleared the last pockets of resistance held by the mutineers.

This commitment and mobilisation enabled us to defeat these opportunists and avert disaster for our country. This treachery will not go unpunished, he added.

Earlier, government spokesperson Wilfried Leandre Houngbedji told news agency Reuters that 14 people had been arrested in connection with the attempted coup.

A journalist in Benin told the BBC that, of those reportedly arrested, 12 are believed to have stormed the offices of the national TV station - including a soldier who had previously been sacked.

Eyewitnesses told the BBC gunfire was heard near the presidential residence early on Sunday morning, as a group of soldiers announced on national TV that they were suspending the constitution.

Their statement cited the ignorance and neglect of the situation of our brothers in arms who have fallen at the front and, above all, that of their families, abandoned to their sad fate by Mr Patrice Talon's policies.

Talon, who is due to step down next year, has been praised by supporters for overseeing economic development, but criticized for suppressing dissenting voices. Recent political tension raises concerns about the stability of Benin amid ongoing regional volatility.