A man walk past a barricade after an election protest in Libreville, Gabon, on Thursday. (Joel Bouopda/Associated Press)

Gabon’s newly reelected president sought to assert authority Thursday as the presidential guard attacked his rival’s party headquarters overnight amid fiery protests. At least three people have been killed, hundreds detained and the Internet blocked.

The opposition alleged election fraud after results announced Wednesday showed that a political dynasty stretching back to the 1960s would remain in power in this oil-rich Central African country.

President Ali Bongo narrowly beat opposition candidate Jean Ping in Saturday’s vote, 49.8 percent to 48.2 percent, according to the electoral commission’s provisional results.

Ping’s supporters have taken to the streets in protest, setting fire to cars and buildings, vandalizing and looting. They burned cars in front of the National Assembly on Wednesday night, after police fired tear gas at hundreds of demonstrators.

Security forces detained 800 people in this city, the capital, and 400 people in other areas of the country, said Interior Minister Pacome Moubelet Boubeya.

The unrest killed at least three people, he said, without giving details.

The president said he was sad about the deaths of citizens and thanked Gabon’s security forces, who he said did all they could to avoid using live bullets.

In a statement, U.N. Secretary General Ban Ki-moon called the response by security forces “disproportionate” and urged the government to “immediately restore communications, especially the Internet.”

About 1 a.m. Thursday, soldiers in green berets, who are known to be part of the presidential guard, fired live rounds during an attack on Ping’s headquarters, injuring at least 20 people, said Paul Marie Gondjout, an opposition official who was there.

Security forces later surrounded the building and remained there Thursday night, detaining more than a dozen members of the National Union opposition party inside, said party spokeswoman Sandrine Akere. Ping was not in the building.

Government spokesman Alain Claude Bilie-By-Nze confirmed the presidential guard operation on the opposition headquarters.

“It was a part of securing the headquarters of Jean Ping, because all of the operations for the capital had been planned there,” Bilie-By-Nze said, referring to the protests. He said at least 16 people were injured and were being treated.

The spokesman called on people contesting the vote to do so through proper legal channels.

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