House Speaker Nancy Pelosi of Calif., arrives to speak to the media, Wednesday Dec. 30, 2020, on Capitol Hill in Washington. Credit: Jacquelyn Martin / AP

WASHINGTON — House Speaker Nancy Pelosi kept her job on Sunday despite Democratic defectors including Rep. Jared Golden of Maine’s 2nd District, giving her the reins of the party’s slender majority as President-elect Joe Biden sets a challenging course of producing legislation to tackle the pandemic and reviving the economy.

The California Democrat, who has led her party in the House since 2003 and is the only woman to be speaker, had been widely expected to retain her post. Pelosi received 216 votes to 209 for Rep. Kevin McCarthy, R-Calif., who again will be the chamber’s minority leader.

Pelosi, who has led House Democrats since 2003 and is the only woman to be speaker, was expected to retain her post despite grumbling among Democrats, a slim 222-211 edge over Republicans and a handful of absences because of the coronavirus.

To be reelected, Pelosi needed a majority of votes cast and could afford to lose only a handful of Democratic votes. Golden, a second-term Democrat who also opposed Pelosi in 2018, was one of five Democrats to not vote for Pelosi, casting his vote for Sen. Tammy Duckworth, D-Illinois. The speaker does not necessarily have to be a House member, though nobody outside the chamber has held the position.

The new Congress convened Sunday, just two days after lawmakers ended their contentious previous session and with COVID-19 guidelines requiring testing and face coverings for House members. There was widespread mask-wearing and far fewer lawmakers and guests in the chamber than usual, an unimaginable tableau when the last Congress commenced two years ago, before the pandemic struck.

Pelosi won plaudits from many Democrats for two years of leading their opposition to President Donald Trump, largely keeping her party’s moderates and progressives united on their joint goal of defeating him and raising mountains of campaign funds. No Democrat has stepped forward to challenge her, underscoring the perception that she would be all but impossible to topple.

But Pelosi is 80 years old, and ambitious younger members continue chafing at the longtime hold she and other older top leaders have had on their jobs. Democrats were also angry and divided after an Election Day that many expected would mean added House seats for the party but instead saw a dozen incumbents lose, without defeating a single GOP representative.

Pelosi recently suggested anew that these would be her final two years as speaker, referencing a statement she made two years ago in which she said she would step aside after this period.

The speaker’s election came 17 days before Biden is inaugurated. Yet rather than a fresh start for him and Pelosi, there were issues and undercurrents that will be carrying over from Trump’s tempestuous administration.

Though Congress enacted — and Trump finally signed — a $900 billion COVID-19 relief package late last month, Biden and many Democrats say they consider that measure a down payment. They say more aid is needed to bolster efforts to vaccinate the public, curb the virus and restore jobs and businesses lost to the pandemic.

Many Democrats, with the unlikely support of Trump, wanted to boost that bill’s $600 per person direct payments to $2,000 but were blocked by Republicans. Democrats want additional money to help state and local governments struggling to maintain services and avoid layoffs.

Biden’s priorities also include efforts on health care and the environment. Guiding such legislation through the House will be a challenge for Pelosi because her party’s narrow majority means just a handful of defectors could be fatal.

In addition, cooperation with Republicans could be made more difficult as many in the GOP are continuing to demonstrate fealty to the divisive Trump, backing his unfounded claims that his reelection loss was tainted by fraud. Congress will meet Wednesday to officially affirm Biden’s clear Electoral College victory over Trump. Many House and Senate Republicans say they will contest the validity of some of those votes, but their efforts that are certain to fail.

There was no widespread fraud in the election, which a range of election officials across the country, as well as Trump’s former attorney general, William Barr, have confirmed. Republican governors in Arizona and Georgia, key battleground states crucial to Biden’s victory, have also vouched for the integrity of the elections in their states. Nearly all the legal challenges from Trump and his allies have been dismissed by judges, including two tossed by the Supreme Court, which includes three Trump-nominated justices.

Meanwhile, it’s not clear which party will control the Senate, which Republicans will hold unless Democrats win both Senate runoff elections in Georgia on Tuesday. In the House, one race in New York is still being decided and there is a vacancy in Louisiana after GOP Rep.-elect Luke Letlow, 41, died after contracting COVID-19.

Story by Alan Fram. AP writers Lisa Mascaro and Andrew Taylor and BDN writer Michael Shepherd contributed to this report.