Violence has erupted in the Gabonese capital after President Ali Bongo was declared winner of a presidential election.

Opposition leader Jean Ping said on Thursday that two people were killed and many wounded when the presidential guard and police attacked his party's headquarters overnight.

"They attacked around 1:00 am (0000 GMT). It is the Republican Guard. They were bombarding with helicopters and then they attacked on the ground. There are 19 people injured, some of them very seriously," said Ping, who was not at the party headquarters.

Ping supporters had clashed with security forces in Libreville after Bongo, the incumbent, was named the winner of the closely-fought election.

Moments after the poll results were announced, anti-government protesters shouting "Ali must go!" tried to storm the offices of the election commission, according to AFP news agency.

The president of the opposition National Union party, Zacharie Myboto, who was inside the besieged building, said security forces were hurling tear gas canisters and had opened fire.

"For nearly an hour the building has been surrounded. They want to enter the building... it is extremely violent," he said shortly after the siege began.

A resident said government forces also attacked the RTN opposition radio and television station.

State television reported that Bongo's ministers would meet on Thursday morning.

Looting and clashes also followed Bongo's last election win in 2009, when he came to power after the death of his father, longtime ruler Omar Bongo.

Bongo won this election with 49.8 percent of the vote, while Ping had 48.23 percent. The constitutional court must finalise provisional results, which came a day later than expected.

UN Secretary-General Ban Ki-moon urged political leaders and their supporters "to refrain from further acts that could undermine the peace and stability of the country." He also called on security forces to exercise restraint.

Supporters of Gabonese opposition leader Jean Ping face security forces blocking the demonstration trying to reach the electoral commission [AFP]
Gabon election: Wage gap a key issue for voters

Election commission members belonging to the opposition immediately denounced the result, with one commissioner for Ping's party, Paul Marie Gondjout, saying the vote had been "stolen".

"They [Ping's camp] say they will not accept this result at all," Al Jazeera's Catherine Soi said, reporting from inside the electoral commission compound in Libreville.

"Protesters came right outside this compound, many of them lighting tyres and chanting anti-government songs," Soi said, adding that explosions could be heard in the distance.

"They were dispersed by the police. Jean Ping has been telling his supporters not to accept a vote that is not favourable to him ... He is telling his people to defend their vote, to defend their choice. They say that they have been cheated."

'Never seen results like these'

Presidential elections are held in a single round in Gabon, with the candidate with the most votes winning outright. The constitutional court now must finalise the provisional results.

Any appeal by Ping would be likely to focus on disputed results in one of the country's nine provinces - the Haut-Ogooue, where Bongo won 95.5 percent of the vote. Results from the province showed a turnout of more than 99 percent, compared with a nationwide turnout of 59.46 percent.

"It's going to be difficult to get people to accept these results," one member of the electoral commission told AFP, asking not to be named because of the sensitivity of the subject.

"We've never seen results like these, even during the father's time."

Opposition delegates in the electoral commission boycotted a vote to approve the results on Wednesday and they have vowed to fight for a recount.

A spokesman for Bongo's campaign, Alain-Claude Bilie-By-Nze, called the vote "free, democratic and transparent", according to the AP news agency. 

Bongo, who secured a second term, has been in power since 2009 [Reuters]

READ MORE: Jean Ping lays claim to Gabon presidency win

Before becoming Bongo's bitter rival, Ping, a 73-year-old career diplomat well known on the international scene, worked with Bongo senior for many years. 

Before the interior ministry's announcement, the European Union, which monitored the election, renewed a call for Gabon to publish "detailed results" for every polling station, urging all actors to help keep peace.

"We invite all stakeholders to exercise restraint, work to maintain civil peace in the post-electoral context and make use of legal channels to resolve any dispute," the EU said.

Source: Al Jazeera News and agencies