President Biden has a clear idea of where America’s foreign policy should be focused: competing with China “to win the 21st century,” without the distraction of the complex, seemingly endless entanglements that have ensnared other presidents.

Biden and his aides have instead spent the past few days feverishly trying to tamp down an eruption of violence in Israel and the Gaza Strip. The president has made an emergency call to Prime Minister Benjamin Netanyahu, and the White House says other U.S. officials have put in more than two dozen calls of their own.

Despite his vision of forging a new foreign policy path and calls from some Democrats to take a tougher line with Israel, Biden’s recent comments have echoed the long-familiar themes of staunch support for the U.S. ally. Biden has declined to join calls for Israel to temper its response.

“One of the things that I have seen thus far is that there has not been a significant overreaction,” Biden said of Israel on Thursday. “The question is how they get to a point where there is a significant reduction in the attacks, particularly the rocket attacks that are indiscriminately fired into population centers.”

Secretary of State Antony Blinken also placed blame on Hamas, the group firing rockets at Israel from Palestinian territory, saying there is a “fundamental difference between a terrorist organization in Hamas that is indiscriminately targeting civilians and Israel, which is defending itself.”

That message is of a piece with Biden’s past pro-Israel views, but it is at odds with a growing number of liberal voices in his own party. The refrain that Israel has a right to defend itself fails to acknowledge “what precipitated this cycle of violence — namely the expulsion of Palestinians and attacks on Al Aqsa” Mosque, Rep. Alexandria Ocasio-Cortez (D-N.Y.) tweeted Wednesday.

“This is not neutral language. It takes a side — the side of occupation,” she wrote.

More broadly, Biden and his team see their central foreign policy mission as reestablishing the United States’ global role after what they consider the isolationist, dictator-friendly and sometimes reckless tenure of former president Donald Trump.

Biden is seeking a careful balance between engagement and intervention: To renew U.S. alliances, he rejoined the Paris climate accords; to avoid costly entanglements, he announced a pullout from Afghanistan.

But the crisis in Israel is showing the limits of Biden’s ability to chart his own course. The most experienced foreign policy president of recent years, Biden has watched a series of presidents take office determined to dramatically shift course from their predecessors, only to see those plans derailed by world events.

“Nearly every U.S. president in recent memory has had his Michael Corleone moment on the Middle East, saying privately to his advisers with frustration, ‘Just when I thought I was out, they pull me back in,’ ” said Brian Katulis, a Middle East and security analyst at the Center for American Progress. “President Biden is having that moment right now.”

Biden’s strategy of focusing on the pandemic, China, climate change and other big priorities fits with the views of most Americans, Katulis added, “but the world has a way of intruding on the best-laid plans.”

Israel escalated its campaign against Hamas on Friday with a combined air and artillery barrage on the Gaza Strip after hundreds of rockets were fired at Israel from the Palestinian enclave. Meanwhile, clashes continued throughout the country between Jewish and Arab citizens.

The administration’s engagement in the growing Gaza conflict offers a contrast of sorts with Biden’s decision to withdraw from Afghanistan after nearly 20 years of war. In announcing that decision last month, the president stressed the need to focus on more pressing fights, chiefly the competition with China.

“We have to shore up American competitiveness to meet the stiff competition we’re facing from an increasingly assertive China,” Biden said at the time. “You know, we’ll be much more formidable to our adversaries and competitors over the long term if we fight the battles for the next 20 years, not the last 20.”

Biden’s engagement in the current Mideast violence — despite his proclaimed shift toward Asia — reflects Americans’ long-standing interest in Israel, as well as Foggy Bottom’s traditional view of the region as critical to U.S. interests. Notably, it comes despite Biden’s desire to distance himself from Netanyahu, viewed by the current White House as a bully who cozied up to Trump.

Netanyahu is also facing legal and political problems at home, and it is not yet clear whether the current violence will help rally support for a new coalition government.

Biden’s views have long been a mix of foreign policy orthodoxy and skepticism about modern wars. He came to oppose the wars in Iraq and Afghanistan as they dragged on past what he thought were appropriate expiration dates, and he opposed expansion of U.S. military action in Syria when the Obama administration was trying to hew to its own “pivot to Asia.”

As a presidential candidate, Biden often said he wanted to end the United States’ “forever wars.” Still, his years as chairman of the Senate Foreign Relations Committee — and eight years as a vice president tasked with many foreign policy missions — suggest Biden knows it’s not that simple.

One former senior U.S. diplomat said Biden has long recognized the gap between a global vision and the sometimes messy reality on the ground.

Biden knew he could not simply “compartmentalize” American power to pick and choose his fights. “It just doesn’t work that way,” the diplomat said, in part because the United States remains the only power with the influence and relationships to avert wider war in the Middle East.

“This is only a predicament if you thought this kind of thing wouldn’t happen,” said the diplomat, who requested anonymity to speak freely about what they said are always difficult Oval Office decisions.

When it comes to the Middle East, the Biden administration is using the familiar tactics of outreach and pressure, leveraging the United States’ unique position to influence Israel and marshal Arab leaders who may have some pull with Palestinian militants.

Hamas, a militant Palestinian faction, controls the Gaza Strip, a swath of seaside territory alongside Israel. The militants regularly fire rockets into Israel, which maintains a tight blockade of the territory.

The United States considers Hamas a terrorist group and avoids direct contact with its representatives, so Egypt, which also borders Gaza, generally acts as a go-between.

Biden was closely involved in the U.S. response to the last major Gaza conflict in 2014. He also played a key role in a 2012 flare-up, when then-President Barack Obama dispatched former secretary of state Hillary Clinton to help broker a cease-fire.

For all Biden’s signals that he would not be as invested in the Middle East as his predecessors, that was always going to be difficult, veteran diplomats say.

“It didn’t take long to get sucked back in — even more rapidly than I would have thought,” said Anne Patterson, a retired Middle East specialist at the State Department and a former ambassador to Egypt.

“Everyone sympathizes with the strategic need to focus on Asia, but the crises are domestic and in the Middle East,” Patterson said. “They will have to sustain attention on the Middle East because it is just too unstable.”

She and others praised the announcement Wednesday that the administration is sending a senior envoy to the region for crisis talks, and she added that those discussions should be sure to include several Arab states.

For Biden, the conflict is even more sensitive because of his current push to reach a new nuclear agreement with Iran, a steadfast enemy of Israel. Such a deal — which also involves Russia, China and several European nations — is a top foreign policy priority for the president and another way for the United States to reclaim its role as a world leader.

Iran funds and arms Hamas, but the Biden administration has walled off the nuclear talks in Vienna from other complaints about Iran’s behavior. Biden’s envoy for Iran, Rob Malley, continued negotiations this week with his Iranian counterparts and the other world powers who were signatories to the original deal.

Blinken on Thursday rejected calls from some Republicans to end the negotiations with Iran because of its support for Hamas.

“An Iran with a nuclear weapon, or with the capacity to have one in on very short order, is an Iran that’s likely to act with even greater impunity when it comes to these other actions,” Blinken told reporters at the State Department.

Blinken dismissed the premise of a letter signed by 44 Republican senators urging Biden to “immediately” end the nuclear negotiations in response to the Gaza crisis. Republicans who have long opposed the deal have sought to distinguish themselves from some Democrats by wholly backing Israel’s military campaign in Gaza this week.

The 2015 deal forged under the Obama administration relaxed economic sanctions on Iran in exchange for the country’s acceptance of restrictions on its nuclear program. Trump abandoned that deal in 2018, and now the original participants are trying to resurrect it.

Biden is not unique in his hope to redirect the United States’ global path. Every president in recent years has taken office determined to shift course from his predecessor on foreign policy.

George W. Bush wanted to confront the so-called “axis of evil” — Iran, Iraq and North Korea — and project American strength after a period of perceived drift under Bill Clinton. Obama wanted to end the wars Bush started and expunge his image as a cowboy on the world stage. Trump’s “America First” populism began with a wholesale reversal of Obama’s global initiatives.

Now it is Biden who is seeking to rapidly change course from the Trump years — reasserting the United States’ global leadership, renewing the alliances that Trump spurned and taking a hard line with the authoritarian leaders who were close to Trump.

Still, Biden and Trump share a skepticism about U.S. involvement in wars in the Middle East, and both had pledged to disentangle the United States from the region’s decades-old tensions.

But Daniel Kurtzer, a former U.S. ambassador to Israel, said the U.S. cannot avoid these conflicts — and therefore it’s wiser to be more involved, not less.

“The administration has studiously avoided dealing with almost any aspect of this issue other than trying to correct some of the most egregious mistakes of the Trump administration,” Kurtzer told NPR this week. “What the violence on the ground and the escalation tells us is that the conflict is not going to give the administration a vacation.”

Katulis put it another way. The Middle East, he said, is the “Hotel California” of foreign policy for U.S. presidents: “You can check out anytime you like, but you can never leave.”

John Hudson contributed to this report.