Sierra Leone's opposition candidate, Julius Maada Bio, has rushed to take his presidential oath in a hotel after winning the run-off election.
Mr Maada Bio is a former military ruler who briefly ruled the country in 1996.
He narrowly beat ruling party candidate Samura Kamara, who has alleged irregularities and says he will challenge the outcome in court.
Mr Maada Bio was sworn in on Wednesday, less than two hours after being declared the winner of Saturday's vote.
Under Sierra Leone's constitution, the presidential vote winner must be sworn in on the same day as he is declared the victor.
"[This is] the dawn of a new era," he said. "The people of this great nation have voted to take a new direction."
In a televised address, Mr Kamara said: "We dispute the results and we will take legal action to correct them." He also urged his supporters to stay calm.
Mr Maada Bio, leader of the Sierra Leone People's Party (SLPP), won just under 52% of the vote.
He has already ruled the country, albeit briefly.
How did Maada Bio come to power before?
Mr Maada Bio, now 53, was part of a group of soldiers who overthrew the government in 1992 when he was in his late 20s.
Then, in January 1996, he staged a palace coup, arguing that his boss, Capt Valentine Strasser, wanted to renege on the promised handover to an elected civilian government.
His supporters point to that to call him the "father of democracy".
But his critics cite human rights violations witnessed while he was in power, for which he has taken "collective responsibility".
During his rule, which lasted just over two months, he appointed Mr Kamara as his finance minister.
Who is he replacing?
The outgoing president, Ernest Bai Koroma, has stepped aside after serving two five-year terms for the All People's Congress (APC). He had hand-picked Mr Kamara as his preferred successor.
Mr Maada Bio lost to Mr Komora in the previous election.
Support for the SLPP and the APC is largely based on ethnicity. The SLPP, the nation's oldest party, is most popular in the southern and eastern parts of the country.
A hard road ahead
By Umaru Fofana in Freetown
Julius Maada Bio was sworn in rather strangely on Wednesday night - at a hotel instead of State House, and less than two hours after he was declared president-elect.
Sierra Leone has what many consider a defective transition arrangement. The constitution says the winner of a presidential election must be sworn in "on the same day" he is declared the winner. To have sworn him after midnight could have triggered a constitutional challenge, after a sometimes acrimonious campaign.
Many believe Julius Maada Bio is the most popular of the candidates who ran for the presidency. But his eventual win was a combination of that popularity and former President Ernest Bai Koroma stepping on many toes.
His administration's response to the Ebola and mudslide crises amid allegations of corruption angered many in the capital, Freetown.
On top of this, even with the country's deep-rooted ethnic politics, tribalism came to the fore more prominently than ever before. Many members of Mr Maada Bio's Mende ethnic group - one of the country's largest - almost worship him, while most ethnic Temnes sided with the APC.
With a narrow outcome, the new president has vowed to heal the divisions, and rebuild the country's broken educational system. He has a tough job ahead of him, made harder by the fact that his party does not have a majority in parliament.
What are the main issues?
Sierra Leone is one of the world's poorest countries, with a fragile economy and widespread corruption.
It suffered heavily during a devastating Ebola outbreak in 2014. The disease killed nearly 4,000 people yet there are still only 200 doctors serving the country of seven million people.
The country also went through a brutal civil war between 1991 and 2002, which killed more than 50,000 people.
Mr Maada Bio has promised to heal the country's divisions and rebuild the country's broken education system.
What happened in the first round?
Mr Maada Bio received 43.3% of the vote in the first round, falling short of the 55% needed for an outright win.
The run-off was delayed by the High Court after a member of the ruling APC party alleged there had been electoral fraud during the first vote.
However, the court rejected a petition by the APC seeking an indefinite suspension of the election to allow for a forensic audit of the original 7 March vote.
After the second round, Mr Kamara said the APC still had "many concerns" about the legitimacy of the results.