WASHINGTON — Nancy Pelosi won’t have much time to relish her party’s takeover of the House.

Though she played a key role in helping Democrats regain the majority for the first time since 2011, Pelosi faces a new battle: regaining the speaker’s gavel amid grumbling from a growing minority of rank-and-file Democrats about the need for new leadership.

The San Francisco Democrat, who has led her party in the House since 2003 including four years as speaker, said she was confident she would be elected speaker again.

“I don’t think anybody deserves anything,” Pelosi said, a reference to President Trump’s comment Wednesday that she “deserves” the job. “It’s not about what you have done. It’s about what you can do. And I think I’m the best person to go forward to unify, to negotiate.”

If elected as speaker, Pelosi becomes the highest-ranking Democratic official in the country and the face of the party until a 2020 presidential nominee emerges.

But the job — which will largely be decided Nov. 28 by an internal party vote — isn’t in the bag yet. A final House floor vote won’t be held until Jan. 3.

Several Democrats, including some incoming lawmakers, publicly distanced themselves during the midterm campaign from Pelosi, who is unpopular with conservatives and no favorite of progressive liberals. Republicans successfully used her as an electoral wedge issue, forcing Democratic candidates to take a stand on whether they would vote for Pelosi as speaker if given the chance.

About three dozen Democrats in competitive races came out against Pelosi to varying degrees, according to surveys of news reports, but as of Wednesday afternoon only 11 had won, and six were in races that hadn’t been called. A handful of sitting members have also voiced opposition to Pelosi’s speakership.

Moves to topple Pelosi are nothing new but rose dramatically in recent years, especially as Democrats’ opportunity to take the House emerged. Critics have long pushed for new leadership, but Pelosi’s effectiveness and fundraising prowess have typically allowed her to beat back challengers.

During the campaign, Pelosi said Democratic candidates in competitive districts were free to distance themselves from her if needed. Winning their seats, she said, was the top priority.

Now the question is whether Pelosi will have enough votes to be elected speaker without those rebels, or can convince some of them to support her after all.

Pelosi tried to tamp down calls for fresh leadership ahead of election day, saying she saw her return to the speakership as a “bridge” to new Democratic leaders.

“I see myself as a transitional figure,” she told The Times last month. “I have things to do. Books to write; places to go; grandchildren, first and foremost, to love.”

Pelosi skeptics warn that the transition argument may not resonate with the new class of Democrats.

“The people that won, our majority makers, campaigned on change,” said Rep. Tim Ryan of Ohio, who won 63 votes in a Democratic secret ballot against Pelosi in 2016. “They didn’t say we’re going to give you a transition. They need to be consulted.” Ryan said he didn’t intend to run but wouldn’t rule it out.

Whoever it is, the incoming speaker will have to lead a fractured, more diverse Democratic caucus.

In one camp are progressives eager to pursue impeachment of Trump and liberal priorities such as Medicare for all. In another are moderates elected in districts won by the president two years ago who may be hesitant to define their party by opposition to the president.

Another question is who — if anyone — will raise their hand to challenge Pelosi. House Democratic sources expect someone will do so. She or he will have only weeks to rally support before the Nov. 28 vote.

Pelosi supporters are confident they will overcome any challenger. “There will likely be some sacrificial lamb and that person will be gladly slaughtered,” speculated one House Democratic aide.

And anti-Pelosi sentiment among Democrats will probably soften after the House victory. “Obviously you don’t fire the coach after you win the World Series,” said Rep. Brad Sherman (D-Northridge).

The late November vote will be among only House Democrats, by secret ballot, to determine whom to put forward as a speaker candidate. On Jan. 3, the first day of the new Congress, the entire House will vote publicly on the new speaker.

The newest Democratic members who have promised to oppose Pelosi could prove to be the most troublesome hurdles to her speakership.

Mikie Sherrill, who won a New Jersey congressional seat Tuesday night, said in May that she wouldn’t back Pelosi. Incoming Virginia Rep. Abigail Spanberger told NBC in July that “under no circumstances” would she support Pelosi.

Nine other incoming representatives — including Jason Crow of Colorado, Jahana Hayes of Connecticut and Anthony Brindisi of New York — made similar calls for new leadership, some quite definitive.

Pelosi’s supporters argue that Democrats can vote against her in the caucus vote in order to keep that promise and still support her on the floor in January.

Others are more skeptical that plan will carry water. Texas Rep. Henry Cuellar, a leader of the Democrats’ conservative Blue Dog Coalition, said it would be hard for members who made an ironclad pledge to undo it.

Pelosi’s ideal, but unlikely, scenario is that no other Democrat enters the race. In that situation, Democrats can argue that their options in the floor vote were either Pelosi or a Republican.

Pelosi has been quietly but indirectly courting her fellow Democrats.

She called each Democratic candidate before the election and was planning to do so again afterward, regardless of whether they won or lost.

Pelosi is a fundraising and legislative powerhouse that no Democrat can match. This campaign cycle she traversed the country, raising a whopping $135.6 million for Democratic candidates, including about half of what the Democratic Congressional Campaign Committee raised this cycle. When she was speaker during the Obama presidency, she led the passage of the Affordable Care Act, a stimulus package and a Wall Street reform bill.

Potential Pelosi challengers are taking a wait-and-see approach, hesitant to take her on but ready to pounce if she can’t get to 218 votes.

“They all have the same strategy: Wait to see if she doesn’t have the votes,” said one House Democratic source who is skeptical of the challengers. “If you want to take her on, take her on. We want someone to take on Trump the bully. But you won’t take on the 78-year-old woman.”

On Wednesday, Pelosi won an endorsement from an unlikely source: Trump, who suggested he would ask Republicans to vote for her for speaker, if needed.

“In all fairness, Nancy Pelosi deserves to be chosen speaker of the House by the Democrats,” Trump tweeted. “If they give her a hard time, perhaps we will add some Republican votes. She has earned this great honor!” The two spoke by phone Tuesday night.

Beyond the race for speaker, the current minority whip, Maryland Rep. Steny H. Hoyer, has said he will run for majority leader, the No. 2 spot. No one so far is challenging him. But underscoring the pent-up demand among next-generation House leaders, other leadership positions are being contested.

Colorado Rep. Diana DeGette said she would challenge South Carolina Rep. James E. Clyburn for the No. 3 job as majority whip.

Rep. Ben Ray Lujan of New Mexico, who led the Democrats’ campaign arm, announced a run for the No. 4 job, assistant Democratic leader, pitting himself against two other potential up-and-comers.

jennifer.haberkorn@latimes.com