LIBREVILLE, Gabon — Gabon’s President Ali Bongo Ondimba has been sworn in for a second seven-year term keeping his family’s dynasty in place for decades after winning re-election by a slim margin in a disputed vote.

Bongo on Tuesday vowed to defend the constitution and to be fair to all. He called for political dialogue with the opposition. But opposition candidate Jean Ping has rejected dialogue, accusing Bongo’s ruling party of vote-rigging.

Gabon’s Constitutional Court on Saturday ruled that Bongo won the Aug. 27 vote despite concerns raised by the opposition and international observers. It said Bongo won 50.66 percent of the vote while Ping got 47.24 percent. Ping said Saturday he would not back down.

Fiery protests and violence erupted in the oil-rich country after provisional results were announced Aug. 31.