California Gov. Gavin Newsom once fashioned himself as a leader of the so-called “Resistance” to President Donald Trump. And he fit the part.

The former mayor of San Francisco, the country’s most left-wing city, Newsom not only opposed Trump, but aspired to be the anti-Trump.

He fought Trump on Twitter and in the courts, defending sanctuary cities and radical climate change regulations even as the homeless population exploded in his state.

Trump fought back, of course.

He excoriated Newsom at rallies and on social media, attacking California’s forest management and water restrictions and automobile emissions standards.

When Newsom was forced to cancel the state’s ill-conceived high-speed rail project last year, Trump demanded that the federal taxpayers be given back the $3.5 billion they were sinking into it. Newsom was shocked when Trump actually followed through on his threat.

And yet in the coronavirus crisis, the two have had nothing but praise for one another.

In early March, when the coronavirus-stricken Grand Princess docked in Oakland, Trump came to Newsom’s aid. When reporters asked Newsom about the president’s response, the governor said Trump had told him: “You have my support, all of our support, logistically and otherwise.” He added: “[E]very single thing he [Trump] said, they followed through on.”

This week, the Trump administration praised California for its aggressive response to coronavirus. It was a tad generous.

Newsom (as lieutenant governor) and his predecessor, Jerry Brown, oversaw the depletion of the state’s stockpile of respirators and the elimination of its mobile hospitals. The emergency supplies had been prepared by Republican Gov. Arnold Schwarzenegger. They fell victim to Brown’s budget cuts, and were never replenished.

Nevertheless, the White House coronavirus task force praised Newsom’s early shelter-at-home policy, giving it credit for slowing the spread of the disease. The administration also sent the USNS Mercy to Los Angeles, and Trump continues to praise Newsom in public.

Newsom returned the favor, again, telling CNN’s Jake Tapper: “[L]et me just be candid with you. I’d be lying to you to say that [Trump] hasn’t been responsive to our needs. He has.”

Trump has been criticized for continuing to debate his critics on Twitter. But he has to do so. In a country where authority is dispersed among more than 50 governors (including the territories) and a dozen big-city mayors, the president cannot afford to have everyone flying in different directions. He cannot hold back aid or equipment; his only tool is the prospect of political embarrassment on his Twitter feed.

There has been none of that with Newsom.

The unlikely Newsom-Trump partnership — call it a “bromance” — formed for several reasons.

First, the sheer scale of the challenge has forced both men to rise to the occasion. As Newsom told Tapper: “I could criticize this or that. At the end of the day, we’re just trying to focus on developing a relationship of trust as a matter of course because there’s too many Americans, 40 million, that live in this state that deserve for to us get together and get along.”

Second, it is not the first time an emergency has pushed them together. Though they squabbled over the cause of California’s wildfires, they also worked together to help those affected by the damage. As Newsom later said during a trip to Washington, DC: “I want to continue to have a relationship with the president on things that matter, and what matters is emergency preparedness, mitigation and suppression.” Two years later, that relationship is crucial.

Third, there are certain useful fictions that facilitate cooperation and public order. And one is the idea that leaders will put partisan differences aside when it matters.

Whatever chaos or squabbling may go on behind the scenes, presenting the country with a united front preserves Americans’ confidence in the government. It helps convince people to stay home and wait. And it allows people to focus on activities more productive than politics.

There is no question that Newsom and Trump have different visions. Newsom told reporters on Wednesday that he sees the crisis as an “opportunity for reimagining a [more] progressive era as it [relates] to capitalism.” Trump, in contrast, has focused on the contributions of private industry, and wants to put the American economy back the way it was.

The fact that they are getting along, regardless, is a sign that America’s painful divisions are not yet fatal.

Joel B. Pollak is Senior Editor-at-Large at Breitbart News and the host of Breitbart News Sunday on Sirius XM Patriot on Sunday evenings from 7 p.m. to 10 p.m. ET (4 p.m. to 7 p.m. PT). He earned an A.B. in Social Studies and Environmental Science and Public Policy from Harvard College, and a J.D. from Harvard Law School. He is a winner of the 2018 Robert Novak Journalism Alumni Fellowship. He is also the co-author of How Trump Won: The Inside Story of a Revolution, which is available from Regnery. Follow him on Twitter at @joelpollak.