The biggest winner of this week’s midterm elections, House Minority Leader Nancy Pelosi, was greeted Wednesday with praise from her two most powerful political rivals.

“I give her a great deal of credit for what she’s done, and what she’s accomplished,” Trump said at the White House, offering remarkable deference to the Democrat from California he had previously nicknamed “High Tax, High Crime Nancy Pelosi” and “MS-13 lover Nancy Pelosi.”

“We’re not unfamiliar with each other,” added Senate Majority Leader Mitch McConnell (Ky.), praising her long service and legislative experience. “When we do things together, it almost never makes any news.”

For Pelosi, 78, it was the return to center stage that she has sought since losing her role as House speaker — the first female House speaker — after the Republican electoral wave of 2010. With Tuesday’s Democratic takeover of the House, Pelosi, the most powerful elected woman in U.S. history and long the principal foil for Republicans, has every intent of becoming the first speaker since Sam Rayburn (D-Tex.) to hold the office more than once.

“I think I’m the best person to go forward, to unify, to negotiate,” she said at her own news conference at the U.S. Capitol. “I’m a good negotiator, as anyone can see.”

Pelosi once had plans to retire with the election of the first female president. Those plans were quashed when Trump defeated Hillary Clinton in 2016.

Now, if she can surmount internal Democratic politics, Pelosi has the potential to reshape the Democratic Party and play a central role in the explosive expansion of power by women in politics, which led to significant Democratic gains among female voters in Tuesday’s elections and an incoming House class that includes more than 100 women for the first time.

She will also be at odds with a president who gained office by insulting and belittling his female adversaries, often calling attention to their looks, and has been publicly accused by 13 women of touching them inappropriately.

A return to the speakership would hand Pelosi the burden of chief Democratic strategist and the party’s public face, at least until a 2020 presidential nominee emerges from the crowded nomination process. She would be tasked with focusing the policy priorities, and avoiding pitfalls, in such a way that positions the party to sweep Trump out of office.

“He understands how effective she is,” Rep. Anna G. Eshoo (D-Calif.), Pelosi’s closest friend in Congress, said of Trump. “He said she’s worked long, she’s worked hard, she’s worked smart, and I think that that’s quite a compliment.”

Pelosi made clear that she had every intention of working with Trump and preventing her own caucus from any “scattershot freelancing” as it ramps up investigations of the administration.

“In terms of working with the president, I just would say that I worked very productively with President [George W.] Bush when we had the majority and he had the presidency,” she said.

But first, she will have to maneuver inside her own caucus for the role.

As it stands, the raw arithmetic of the incoming Democratic majority remains an obstacle. An expected Democratic majority of 11 seats or thereabouts could give a small group of Democrats leverage to demand a shake-up of a leadership team that is distanced from the younger and more activist Democrats who will soon join the House.

Four sitting Democrats voted against her in the last speaker election, and at least 12 of the incoming House Democrats made statements critical of Pelosi on the campaign trail, ranging from a general call for new leadership to a firm refusal to support her becoming speaker again. Seven more Democratic candidates in that category are running in races yet to be called.

“We don’t want to be disrespectful to anyone who served, particularly a woman who’s broken glass ceilings like Nancy Pelosi,” said Elissa Slotkin, who dispatched Rep. Mike Bishop (R-Mich.) on Tuesday. “But we need to hear what people are telling us, and they’re saying on both sides of the aisle they want a new generation of leadership.”

Pelosi refused to directly address the palace intrigue in her news conference Wednesday, and her advisers are hopeful that it can be sorted out with a reshuffling of other leadership roles.

In a letter sent to members Wednesday night, Pelosi asked for their support and said she planned to speak to every House Democrat over the coming weeks “to gather the best ideas on how to strengthen the institution we serve and to honor our responsibilities” under the Constitution.

“My vision for the next two years is to restore the House to the role it should have as a strong and independent voice for the American people,” she wrote.

Speaking to reporters, she put her pitch more succinctly: “It is not about what you have done; it’s about what you can do.”

But it did not escape many that the issue most responsible for the Democratic takeover — the party’s support for Obamacare and its protection of preexisting conditions — was only made possible because Pelosi forced the health-care legislation through during her first turn as speaker.

Her performance this week suggests she is still very much campaigning for the job, which is likely to be decided behind closed doors at a Democratic caucus meeting later this month.

Pelosi raised $135.6 million in the 2018 cycle, and she traveled widely in the final weeks of the race — though mainly in more liberal-leaning districts. Democrats in swing districts and those that leaned Republican mostly kept her at arms’ length.

As polls came in Tuesday night showing a sweeping Democratic House victory in the works, she declared “a new day in America.” She has spent considerable time since then looking beyond the leadership elections to her plans for working with Trump on issues such as drug prices and infrastructure.

“She has basic rules that apply to her own role,” said former congressman Steve Israel (D-N.Y.), a close ally who saw her last week at the wedding of a wealthy Democratic donor. “First, you own the ground. You don’t allow your opponents to fill in a narrative against you.”

The other big rule, Israel continued, is to know how to count votes and bring together her caucus. The daughter of a congressman turned mayor of Baltimore, she still conducts herself with the formality of a bygone age, matching resolve with more mundane pleasantries.

Since Trump’s election, Pelosi has taken a firm but restrained approach to the president, frequently critiquing the damage of his policies and his departures from fact, without resorting to direct attacks.

She also has worked inside her party to keep political strategy focused on policy, not Trump’s personality. On Wednesday, she told reporters that she has long urged fellow Democrats not to “take the bait” and be lured into divisive immigration debates with Trump.

“For all the diversity of opinions, she’s the one that’s held everyone together,” Eshoo said.

Her stature as a target of Republican disdain is unquestioned, as GOP pollsters have repeatedly found in her a useful shorthand for motivating conservatives and dissuading moderate independent voters from voting Democratic.

In August and September, about 7 percent of Republican television ads mentioned Pelosi, compared with 10 percent of Democratic ads that mentioned Trump, according to the Wesleyan Media Project, which has ranked Pelosi as the most mentioned congressional leader in campaign ads in every cycle since 2010.

“You would have thought that Nancy Pelosi was on 100 different ballots across America the way that she was attacked by Republicans,” said Rep. Eric Swalwell (D-Calif.), a young Pelosi ally. “Despite that, we made big gains in the House, so the argument that she was a drag on candidates just does not hold.”

Trump rarely let a political event go by without name-checking her as one of several personifications of the threat of liberal rule. But he has also been more restrained in his attacks on her than some other rivals, usually choosing to speak her name without a derisive nickname. Early in his term, Trump met repeatedly with Pelosi and Senate Minority Leader Charles E. Schumer (N.Y.) — “Chuck and Nancy,” the president called them — to try to strike deals, a strategy that dissolved after he went back to stirring his base by denouncing Democrats.

The president told reporters Wednesday that he would be willing to encourage Republicans to vote for her as speaker if she runs into trouble getting the roughly 218 votes she will need next year to be elected to the post.

“I think I would be very able to supply her the necessary votes,” Trump said.

Pelosi has responded by calling Trump “the great organizer” of her party, and continued to wear her gay pride Apple Watch band in the Oval Office, a rejoinder to the president’s policies.

“I’m respectful of the office he holds,” she told The Washington Post last year. “One of the things that I have tried to convey in our conversations is that we have to have evidence-based conversations — with facts.”

At their first meeting at the White House, days after his inauguration, Trump began boasting about how he had won the popular vote in 2016 election, which he did not.

Pelosi decided to speak out of turn: “Mr. President, that’s not true.”