President George Weah, a former soccer star whose administration had weathered accusations of corruption, announced that he had lost his bid for re-election to Joseph Boakai, a 78-year-old former vice president.Liberia’s president, George Weah, conceded defeat on Friday night in his bid for a second term, after a tight runoff against Joseph Boakai, a 78-year-old political veteran, in an election that was considered a test of democracy in the West African nation.Mr. Boakai, who had served as vice president for 12 years under the former president, Ellen Johnson Sirleaf, defeated Mr. Weah, a 57-year-old former soccer star, by a razor-thin margin. The country’s national election commission stopped short of declaring a winner on Friday afternoon, but announced that with more than 99 percent of the ballots counted, Mr. Boakai held 50.89 percent of the votes, and Mr. Weah 49.11 percent. It was the nation’s tightest election in two decades, and a rematch of the election in 2017, when Mr. Weah handily beat Mr. Boakai. Mr. Weah said in a radio address broadcast late on Friday evening that while his party had lost the election, “Liberia has won.”“This is a time for graciousness in defeat, a time to place our country above party, and patriotism above personal interest,” he said. His words marked a notably peaceful transition of power at a time when many other West African countries have endured a spate of coups, aging leaders clinging to power and elections plagued by allegations of vote rigging.In Nigeria and in Sierra Leone, independent observers have cast doubt on the results of presidential contests this year. In Niger and Guinea, juntas rule despite international efforts to restore civilian governments.This is the first time since the early 1900s that an incumbent president of Liberia has not been re-elected after serving one term. The swearing-in ceremony is scheduled for January.The election, first held on Oct. 10 with the runoff on Tuesday, was the first one managed solely by Liberian authorities without international funding or assistance since the country emerged in 2003 from a ruinous civil war.Mr. Boakai plans to speak publicly on Saturday, his spokesman said. The candidate told Reuters on Friday night, “First and foremost, we want to have a message of peace and reconciliation.”The presidential campaign hinged on accusations that Mr. Weah tolerated corruption in government circles and failed to deliver jobs and development, despite the country’s economic rebound after the pandemic.One voter in the capital, Monrovia, said that he had cast a ballot for Mr. Boakai because of his promise to crack down on drug abuse and corruption.“It’s unthinkable that you would see young people getting addicted to drugs, and the president doesn’t have any idea how to tackle it,” said the voter, MacPherson Darweh, who is 45.Mr. Weah “doesn’t have a sense of belonging and does not even know how the country has been governed and run,” Mr. Darweh said. “He still thinks he is a football player running around town.”President George Weah casting his vote in Monrovia in the first round of voting last month.Guy Peterson/Agence France-Presse — Getty ImagesLiberia, a country of 5.5 million people, declared independence in the 19th century — a century ahead of most African countries — with a democratic political system that was modeled on that of the United States.But the country was racked by civil wars from 1989 to 2003 that left about 250,000 people dead.The Ebola epidemic between 2013 and 2016 also killed thousands, leaving the country in a precarious state and prompting the United Nations to take over organization of the country’s elections — until this year.Liberia’s economy grew by 4.8 percent in 2022, according to the World Bank, mainly driven by mining and a relatively good agricultural harvest. But more than 80 percent of the population is food insecure, the World Bank said in July, and prices of basic food products and fuel have skyrocketed over the past year, with over half of Liberians living below the poverty line, on $1.90 a day.A team of observers from the Economic Community of West African States on Wednesday congratulated Liberians for “the generally peaceful conduct of the elections so far.” The European Union said in a statement that Tuesday’s runoff was “calm” and “well organized,” and there were “organizational improvements” compared to the first round.Police officers in riot gear patrolled the streets of Monrovia, the Liberian capital, as the vote proceeded, while polling workers counted ballots late into the night by lamps and flashlights because of power cuts, which have become common in the country.Mr. Weah and Mr. Boakai had finished almost neck and neck in the first round of the election, with neither passing the 50 percent threshold required to be declared the outright winner. Mr. Weah had a narrow lead, by just over 7,000 votes.Supporters of Mr. Boakai and his Unity Party in Monrovia last month. In Liberia, 60 percent of the population is under 25. Guy Peterson/Agence France-Presse — Getty ImagesMr. Boakai, a political veteran in Liberia, served as agriculture minister in the 1980s, and director of the state-owned Liberian Petroleum Refinery in 1992, when the civil war raged. Although he was not implicated in any corruption scandals, as vice president he was accused by his critics of turning a blind eye to corruption in the government.In this year’s election, he seemed to gain traction by portraying himself as a safe pair of hands to steer the country in a new direction. He focused on grievances with Mr. Weah’s rule, criticizing his opponent for his lavish lifestyle and for being out of touch with Liberian society.But Mr. Boakai’s opponents focused on his being nearly 80 years old, and nicknamed him “Sleepy Joe,” accusing him of napping during a public event.The election was a rerun of the vote in 2017, when Mr. Weah defeated Mr. Boakai by a relatively large margin, capitalizing on his status as a sports superstar and political outsider who claimed he could better the lives of ordinary Liberians.Last time around, Mr. Weah’s story of ascent to the pinnacle of world soccer after growing up in a Liberian slum had resonated with young people in a nation where 60 percent of the population is under 25.But his image as an advocate for the poor cracked under the weight of graft scandals, a failure to deal with the drug crisis and soaring living costs. Under his government, Liberia has fallen 20 places on a corruption index compiled by Transparency International, ranking 142nd last year out of 180 countries.Last year, the U.S. Treasury imposed sanctions on three Liberian officials, including Mr. Weah’s chief of staff, Nathaniel McGill. An investigation promised by Mr. Weah has yet to materialize.Officials with the National Elections Commission counting runoff ballots in Monrovia, on Tuesday. They worked into the night by flashlights and lamps because of power cuts, which are common in Liberia.Carielle Doe/Reuters More