Gov. Gavin Newsom of California met Wednesday for more than an hour with President Trump as he made his case for federal aid to help residents recover from the worst natural disaster the Los Angeles region has ever endured.

It’s a scene few would have predicted even two months ago: a Democrat who served as a reliable attack dog in 2024 sitting down with a Republican president who has enraged liberals since taking office last month. In doing so, Mr. Newsom is believed to have become the first Democratic elected official to meet with Mr. Trump in the Oval Office this term.

The meeting illustrated just how much the governor’s public stance has changed since the election. It initially seemed that Mr. Newsom, who is seen as a potential presidential contender in 2028, was taking his familiar place as a leader of the resistance from his West Coast perch. “California is ready to fight,” he declared on social media two days after the election.

But since then, Mr. Newsom has found himself navigating a political landscape shaped both by Mr. Trump’s electoral gains and the wildfires that tore through two Los Angeles communities, killing 29 people and destroying thousands of homes. As Mr. Trump has threatened to withhold disaster aid from the state, Mr. Newsom has tempered his criticism of the president.

The two leaders had “a very productive meeting” at the White House, Mr. Newsom’s spokesman, Izzy Gardon, said on Wednesday.

Mr. Newsom “expressed his appreciation for the Trump administration’s collaboration,” Mr. Gardon said. The governor also thanked Lee Zeldin, the head of the Environmental Protection Agency who dialed in for part of the meeting, for deploying more than 1,000 workers to help with debris removal.

Even as Mr. Trump has provoked other Democratic governors into outrage, Mr. Newsom has shrugged off moves by the White House that might have once set off his wrath.

Mr. Newsom did not participate in a phone call last week in which half a dozen Democratic governors, including Kathy Hochul of New York and JB Pritzker of Illinois, pressed Senator Chuck Schumer, Democrat of New York, to be more aggressive in combating the president’s agenda.

When Mr. Trump falsely said last week that the U.S. military had come into California and sent water gushing from the Pacific Northwest, Mr. Newsom offered a charitable interpretation of the president’s words, suggesting that Mr. Trump was perhaps celebrating the resumption of federal water pumps that had been down for maintenance.

As many Democratic officials fumed over a Trump executive order that appeared to halt federal funding, Mr. Newsom said that he was withholding judgment.

And Mr. Newsom appears to have met with Mr. Trump in the Oval Office even before Democratic leaders in Congress this term. The president met with Senator John Fetterman, Democrat of Pennsylvania, last month at Mar-a-Lago, Mr. Trump’s private club.

“I don’t think that it is a particularly smart time to be pressing the resistance agenda,” said Lanhee Chen, a moderate Republican who ran unsuccessfully for California state controller in 2022 and teaches public policy at Stanford University. “His bending the knee in some ways is probably appropriate given the reality of what the state needs from the federal government right now.”

Mr. Newsom has approved $2.5 billion in state funds for fire recovery in Los Angeles, which he hopes will be reimbursed by the federal government. Shortly after the fires began on Jan. 7, former President Joseph R. Biden Jr. pledged that the federal government would reimburse the state for the entire cost of the recovery.

But President Trump has repeatedly said that he wants California to change policies on water management as a condition of receiving disaster aid. He also suggested he would withhold aid until the state passed a voter identification requirement.

The governor has said there should be no conditions on the aid to help fire victims. Instead, he has emphasized the steps he’s taken to speed clean up and rebuilding.

In the initial weeks of the second Trump administration, Democrats have struggled to figure out a strong opposition message to counter the president. Mr. Schumer faced some ridicule this week for a news conference in which he held up a can of Corona beer and an avocado to warn that Mr. Trump’s tariffs on Mexico and Canada would affect Super Bowl parties.

With other Democrats unable to effectively counter Mr. Trump, Mr. Newsom has not been held to account for pulling his own punches.

And the sheer magnitude of the wildfires has given Mr. Newsom a degree of leeway from his liberal base. Several Democratic activists in California said on Wednesday that they trusted the governor to stick up for California’s liberal policies while building ties with Mr. Trump that would help Los Angeles recover.

“It’s a tricky obstacle course to run, and I think the governor is doing the best that he can,” said Hans Johnson, president of the East Area Progressive Democrats, a club based in the region where the Eaton fire burned down Altadena. “He has shown the adroitness to do both.”

But Jessica Millan Patterson, the chairwoman of the California Republican Party, criticized Mr. Newsom as a hypocrite, saying he “continues his desperate attempt to ‘Trump-proof’ California while simultaneously running to President Trump for help.” She was referring to state legislation awaiting the governor’s signature that would devote $50 million for litigation against the Trump administration and legal aid for undocumented immigrants.

The president also met on Wednesday with Gov. Greg Abbott of Texas to discuss border security. Mr. Abbott said afterward that their discussion included how much of the border wall the state of Texas has completed. “We have identified 4,000 jail cells in the state of Texas that can be used as detention facilities,” Mr. Abbott said.

Mr. Newsom has tempered his criticism of Mr. Trump before. Days after he was elected governor in 2018 following a campaign filled with his own broadsides against Mr. Trump, a wildfire eviscerated the mountain town of Paradise, Calif., killing 85 people. The two men met amid the wreckage.

Ann O’Leary, who was Mr. Newsom’s chief of staff at the time, said that she remembered talking with the governor-elect before he met the president. She told him about her own experience working for Hillary Clinton, who was a Democratic senator for New York at the time, during the Sept. 11 attacks. Mrs. Clinton had to work closely with President George W. Bush, a Republican.

Mr. Newsom had the same cooperative mind-set when he met Mr. Trump, she said, “and I think it was a very critical trip, because it established their personal relationship with one another.”

That proved useful during the Covid-19 pandemic, when Mr. Newsom received help from the Trump administration. Then, like now, Mr. Newsom was conciliatory with the Republican president while other Democrats blasted him.

And then, like now, California challenged the Trump administration in court as Mr. Newsom displayed comity.

In the first two weeks of Mr. Trump’s second term, California already has been involved in two lawsuits challenging the president, one seeking to reverse a freeze on federal funding and another attempting to stop an executive order that would limit birthright citizenship. Federal judges have since blocked both efforts by the Trump administration, the federal funding order temporarily and the birthright order indefinitely.

Mr. Newsom so far has said little about the litigation, allowing Rob Bonta, the California attorney general, to be the face of the state’s legal battle against Mr. Trump.

The same day that Mr. Bonta sued to block the federal funding freeze, calling it “reckless and dangerous,” Mr. Newsom said that he would not “react to it in a negative light.” The governor, speaking to reporters last week, said that he and the president “have a good interpersonal relationship.”

“I enjoyed spending time with him,” Mr. Newsom said about greeting Mr. Trump recently in Los Angeles. “I’m not saying that as a politician.”