President Biden this past week laid out a defiant defense of his decision to withdraw from Afghanistan, a reversal of two decades of U.S. engagement that crystallizes an emerging Biden Doctrine — a cautious worldview that prizes alliances but also narrows the aperture of American influence.

The United States, with plenty of rebuilding to do at home, should no longer be willing to intervene in languishing foreign conflicts, Biden said. The lives of American troops are not worth risking in those battles, he added, and nation-building is a non-starter. That is a view broadly shared by Americans in both parties even amid the scenes of chaos and heartbreak at the Kabul airport in recent days, as desperate Afghans try to flee a Taliban takeover.

“What interest do we have in Afghanistan at this point, with al-Qaeda gone?” Biden asked Friday, overstating the case that the terrorist group behind the Sept. 11, 2001, attacks has been extinguished. He added moments later: “You’ve known my position for a long, long time. It’s time to end this war.”

Americans have soured on the kind of inconclusive military missions that President Donald Trump said make “policemen” out of soldiers. Biden had soured on them more than a decade ago, as his once-hawkish foreign policy grew more circumspect.

That convergence is among several instances in which — for all their vast differences in policy, motivation and tone — the new president finds himself on common ground with the old.

Biden so far has kept many of the protectionist tariffs that he inherited, continuing the trade limitations that Trump had placed on Chinese imports. He has kept in place some of the Trump-era border policies that advocates have pressed him to overturn, such as pandemic travel restrictions at the Mexico and Canada borders that the Biden administration extended Friday.

And while Biden displays a ­belief in diplomacy and working with like-minded countries on priorities like climate change and the coronavirus, the longtime senator who supported the Iraq War in 2002 and initial actions in Afghanistan has shown an increasing aversion to an interventionist foreign policy.

Since April, the Biden administration has given no fewer than a half dozen explanations for the slow withdrawal of Afghan allies from Afghanistan. (JM Rieger/The Washington Post)

Last week included not only a vivid display of a chaotic evacuation from Afghanistan — one that deeply shook many NATO allies and triggered criticism from alliances Biden prizes — but also a decision from the administration to override concerns from the World Health Organization and recommend booster shots for Americans, giving them a third shot before millions in poorer countries have their first.

“The bigger thing that’s consistent between Obama’s second term to Trump to now how Biden has started out is: ‘We take care of our own,’ ” said Brian Katulis, a foreign policy expert at the left-leaning Center for American Progress who has referred to the latest turn in foreign policy as “the gated community mind-set.”

“Call it ‘America First,’ call it ‘America First Lite.’ But we take care of our own first and foremost and there’s only so much we can do on things that are on the other side of that gate.”

Close Biden aides dispute that there are significant similarities between the worldviews of Biden and Trump, and say any policy overlap is by happenstance.

“If somehow two people end up on the same street — that doesn’t have anything to do with doctrine,” said one person close to Biden, speaking on the condition of anonymity to be candid about the president’s views.

Part of Biden’s argument on Afghanistan holds that American global priorities are elsewhere, especially in Asia, and that money, time and brainpower should be redirected to what he calls the defining challenge of the 21st century — the looming contest with China for economic, military and diplomatic preeminence.

Trump painted China as a boogeyman, first on trade when he ran for president in 2016 and then as the origin of the coronavirus when he was running for reelection in 2020. In between, he cultivated a relationship with Chinese President Xi Jinping and sought an omnibus trade deal that never gelled.

Sen. Chris Murphy (D-Conn.), a Biden ally who has backed the president’s approach to ending the Afghanistan war, cast Biden’s view of China as far more sophisticated and practical and as an example of where shared positions between Trump and Biden do not, in his view, mean shared values.

“What Joe Biden is trying to do is arrange American foreign policy so we’re negotiating from a position of strength with China, something that Donald Trump could not do and had no interest in doing,” Murphy said.

Domestic U.S. concerns are a big part of that calculus, Murphy said, pointing to Biden’s legislative agenda with its focus on rebuilding the American economy, infrastructure and global competitiveness.

A top administration official said the emerging Biden Doctrine is guided by rebuilding at home, partly as a way to demonstrate the power of democracy, and working with like-minded partners to address global challenges.

Afghanistan is Exhibit A in Biden’s view of how not to apply American power, but it is complicated by his avowed belief that the United States draws strength from its alliances. NATO fought alongside the United States in Afghanistan, and several NATO nations have complained that they were blindsided by Biden’s abrupt announcement in April of a complete withdrawal.

The decision to leave Afghanistan also comes amid broad misgivings about the 20-year conflict on both the right and the left. An Associated Press-NORC poll released Thursday found that nearly two-thirds of Americans doubt the war was worthwhile, including 67 percent of Democrats and 57 percent of Republicans.

“Going back to his decades in the Senate, the core of the president’s foreign policy vision has always been the same,” said Jake Sullivan, a longtime aide and current national security adviser. “A strong America that works together with partners and allies to stand up for our shared values, advance our shared interests and demonstrate — even in the face of new and accelerating global challenges — that democracy can deliver for the American people and for people around the world.”

Biden’s first message to the world as president was that “America is back,” and he spent his opening months in office in a dramatic pivot away from Trump-era policies. He reentered the Paris climate accords and convened a virtual global conference that included both adversaries and allies united around fighting climate change. He recommitted the United States to the Iran nuclear deal, with new talks centered on stitching the agreement back together, and he ended a ban on those traveling from several majority-Muslim countries.

Biden has also tried to abide by what his campaign called “a foreign policy for the middle class,” saying his lodestar when making foreign policy decisions would be how they would impact average Americans. It meant fortifying American democracy at home as a contrast to autocracies abroad, ending some U.S. troop deployments and seeking to rebuild American infrastructure.

He has kept tariffs on China that were imposed by Trump, although administration officials say they are still reviewing whether to keep them. He has helped get 130 countries to endorse a blueprint for a global minimum tax, which is aimed at stopping countries from luring large multinational corporations by offering low tax rates.

“Those of us who conduct foreign policy haven’t always done a good job connecting it to the needs and aspirations of the American people,” Secretary of State Antony Blinken said in an early speech outlining the administration’s foreign policy goals. “As a result, for some time now Americans have been asking tough but fair questions about what we’re doing, how we’re leading — indeed, whether we should be leading at all.”

Some of that has led to a more inward-looking country, one that focuses far more on domestic issues and one that is less about influencing events in other countries.

“Until we address some of our domestic issues, we’re going to be less capable internationally than we could be,” said Douglas E. Lute, a former NATO ambassador and retired general who directed Afghan strategy on the National Security Council for Presidents George W. Bush and Barack Obama. “I think certainly through this administration — even a two-term Biden presidency — I think the domestic priorities are likely to dominate, just because of their magnitude.”

Biden has also taken a skeptical view of the use of military force, one that those who have worked with him on foreign policy say is rooted in lessons he learned from Vietnam, the most formative issue of his early life. He was a leading voice during the early part of the Obama administration on reducing the military presence in Afghanistan. He has spoken directly about the dedication and the concern among military families, often citing the service of his late son, Beau, who was deployed for a year in Iraq as a member of the Delaware Army National Guard.

But the ways in which Biden’s administration has carried out the Afghanistan withdrawal have triggered questions from some traditional allies about whether Biden’s past rhetoric about the importance of American allies and diplomacy has been carried out.

Heather Grabbe, the director of the Open Society European Policy Institute, said the Biden Doctrine appears to be anti-intervention and pro-alliance, with an emphasis on building relationships with other leaders and allies.

His first foreign trip was aimed at rebuilding alliances, and for many of those allies his decision to withdraw from Afghanistan was unsurprising. But the way it happened, Grabbe said, has “been a shock in Europe.”

“Where is the discussion with all the allies?” she said. “There’s been much less public discussion with allies of the United States — including those who went into Afghanistan with the U.S. — than allies expected.”

Tomas Valasek, Slovakia’s former ambassador to NATO, said the messy exit from Afghanistan leaves those European leaders “who worked hard to build a case for the Afghanistan war looking foolish because they cast their lot with the American government.”

The optics are bad, he said, and they’ll only get worse when Biden hosts a virtual summit celebrating democracies in December.

“Biden is going to show up and talk about the importance of democracy and democracy-building and he’s going to be looking at a screen full of stony faces,” said Valasek, who is now a member of the Slovak parliament.

Radoslaw Sikorski, a member of the European Parliament who chairs the delegation for U.S. relations, said that though Biden and Trump have vast stylistic and policy differences, Biden has some echoes of his predecessor’s “America First” attitude.

In Biden’s first speech after the fall of Kabul, for instance, “the language was not as nationalistic, but the logic was similar” to that of the Trump administration, Sikorski said. “Namely, that America should not seek monsters to slay abroad.”

It’s an approach Sikorski favors, but the implementation has been painful, especially in Afghanistan, and it carries risks, he said.

“I hope that Afghanistan will not play the role of the infamous ‘red line’ that President Obama drew in Syria and didn’t enforce,” Sikorski said, referring to Obama’s decision not to launch airstrikes against Syria after President Bashar al-Assad used chemical weapons on his own people. “If President Biden is seen as a pushover in Afghanistan, then adversaries might get bolder in challenging American interests in other places.”

The episode has already reignited debate over Europe’s “strategic autonomy,” the need for the E.U. to become more independent, especially on defense issues, that percolated during the Trump years.

The Biden administration’s approach to Latin America offers a number of clear contrasts with Trump. It has focused far more on anti-corruption and pro-democracy efforts in Central America, viewing poor governance as a key driver of migration. It has held talks with regional officials on creating aid programs to help migrants fleeing poverty and jettisoned the border wall and the agreements forcing asylum seekers to return to Central America. Biden’s administration also ended the Migrant Protection Protocols, under which asylum applicants were required to wait months for their asylum appointments in dangerous Mexican border cities.

Still, to the frustration of migration advocates, Biden has kept in place Title 42, the emergency public health rule used to expel most asylum seekers arriving at the U.S. southern border.

“There was an expectation that Biden’s foreign policy would be extremely different, radically different, from Trump’s, and that has not been the case,” said Guadalupe Correa-Cabrera, a professor at George Mason University and former president of the Association for Borderlands Studies.

Julián Ventura, a former senior Mexican official and career diplomat, said there have been some notable shifts in approach, with the Biden administration taking on a far less confrontational approach than Trump and harking back to an Obama-era foreign policy that attempted to shift toward Asia.

But just as Obama had to pivot to crises in the Middle East, he added, “reality draws you toward the crisis in Afghanistan.”

Thebault reported from Brussels. Mary Beth Sheridan and Alejandra Ibarra Chaoul in Mexico City contributed to this report.