A year ago, President Joe Biden braced for the worst as Russia massed troops in preparation to invade Ukraine.

As many in the West and even in Ukraine doubted Russian President Vladimir Putin’s intentions, the White House was adamant: war was on the way and Kiev was woefully overrun.

In Washington, Biden’s aides prepared contingency plans and even drafted what the president would say if Ukraine’s capital were to quickly fall to Russian forces — a scenario considered likely by most U.S. officials. The president of Ukraine, Volodymyr Zelenskyy, was offered help to get out of his country if he wanted it.

But as Russia’s invasion reaches the one-year mark, the city stands and Ukraine has beaten even its own expectations, backed by a US-led alliance that has agreed to equip Ukrainian forces with tanks, advanced air defense systems and more, while Kiev’s government floats tens of billions of dollars in direct aid.

For Biden, Ukraine was an unexpected crisis, but one that fits perfectly with his larger foreign policy view that the United States and like-minded allies are in the middle of a generational conflict to show that liberal democracies like the United States can overcome autocracies.

In the White House’s estimation, the war turned what had been Biden’s rhetorical warnings — a staple of his 2020 campaign speeches — into an urgent call to action.

Now, as Biden prepares to travel to Poland to mark the anniversary of the war, he faces a legacy-defining moment.

“President Biden’s job is to make the case for sustained free world support for Ukraine,” said Daniel Fried, a US ambassador to Poland during the Clinton administration and now a distinguished fellow at the Atlantic Council. “This is an important trip. And really, Biden can define the role of the free world in turning back tyranny.”

Biden administration officials are quick to direct primary credit for Ukraine’s resilience to its armed forces, with a supporting role given to the ineptitude of the Russian military. But they also believe that without their early warnings and the massive support they orchestrated, Ukraine would have been all but wiped off the map by now.

Sustaining Ukraine’s struggle, while keeping the war from escalating into a potentially catastrophic broader conflict with NATO, will be one of Biden’s lasting foreign policy achievements, they argue.

In Poland, Biden will meet with allies to reassure them of America’s commitment to the region and to help Ukraine “as long as it takes.” It’s a promise met with skepticism at home and abroad as the invasion enters its second year, and as Putin shows no sign of backing down from an invasion that has left more than 100,000 of his own forces killed or wounded , along with tens of thousands of Ukrainian officials and civilians — and millions of refugees.

Biden’s job now is, in part, to convince Americans — and a worldwide audience — that staying in the fight is more important than ever, while warning that an endgame is unlikely to come quickly.

His visit to Poland is an opportunity to tell “countries that reject archaic notions of imperialist conquest and war of aggression about the need to continue to support Ukraine and oppose Russia,” said John Sullivan, who resigned as US ambassador to Moscow in September. “We always preach, we try to protect a rules-based international order. It’s quite clear if Russia gets away with this.”

America’s resolve to stand up to Russia is also being tested by domestic concerns and economic uncertainty.

Forty-eight percent of the American public say they favor the United States providing arms to Ukraine, with 29% opposed and 22% saying they are neither in favor nor opposed, according to a poll published last week by The Associated Press-NORC Center for Public Affairs Research. It’s evidence that support has slipped since May 2022, less than three months into the war, when 60% of American adults said they were in favor of sending Ukraine arms.

Further, Americans are roughly evenly split on sending government funds directly to Ukraine, with 37% in favor and 38% opposed, with 23% saying neither, according to the AP-NORC poll.

This month, 11 House Republicans introduced what they called the “Ukraine Fatigue” resolution calling on Biden to end military and economic aid to Ukraine, while pressuring Ukraine and Russia to reach a peace deal. Meanwhile, the more traditionalist national security wing of the GOP, including just-announced presidential candidate Nikki Haley, a former UN envoy in 2024, has criticized the pace of US aid and pushed for a faster transfer of more advanced weapons.

“Don’t look at Twitter, look at people in power,” Senate Republican leader Mitch McConnell told the Munich Security Conference on Friday. “We are determined to help Ukraine.”

But Sen. Dan Sullivan, R-Alaska, said he wants the president and his administration to impress upon allies the need to share the burden as Americans grow weary of current levels of U.S. spending to help Ukraine and Baltic allies.

Sullivan said he hears from Alaskans: “Hey, Senator, why are we spending all this? And how come the Europeans aren’t?”

From the beginning of his administration, Biden has argued that the world is at a defining moment pitting autocracies against democracies.

The argument was originally created with China in mind as America’s biggest economic and military adversary, and with Biden wanting to reorient US foreign policy towards the Pacific. The pivot to Asia is an effort that each of his recent predecessors tried and failed to complete as wars and foreign policy crises elsewhere shifted their attention.

With that goal, Biden sought to quickly end the U.S. military presence in Afghanistan seven months into his term. The end of America’s longest war was overshadowed by a chaotic withdrawal as 13 American soldiers and 169 Afghan civilians fleeing the country were killed in a bombing near Kabul’s international airport carried out by the Islamic State’s Afghanistan branch.

U.S. officials say the decision to pull out of Afghanistan has given the administration bandwidth and resources to focus on helping Ukraine in Europe’s first land war since World War II while increasing its focus on countering China’s assertive actions in the Indo-Pacific region.

While the war in Ukraine caused large price increases in energy and food markets — exacerbating rampant and persistent inflation — Biden aides saw domestic benefits for the president. The war, they argued, allowed Biden to demonstrate his ability to work across the aisle to maintain funding for Ukraine and showcase his leadership on the global stage.

However the coming months unfold, it’s almost certain to be messy.

While Biden last year had to walk back a public call for regime change in Russia that he had delivered from Poland just weeks after the war began, U.S. officials increasingly see internal discontent and domestic pressure on Putin as key to ending the conflict .

“So how does it end?” Undersecretary of State Victoria Nuland said at an event last week in Washington to mark the upcoming anniversary. “It ends with a secure, viable Ukraine. It ends with Putin limping back from the battlefield. I hope it eventually ends with a Russian citizen, who also says, ‘It was a bad deal for us and we want a better one future.” “

When Biden hosted Zelenskyy in Washington in December, the US president encouraged him to pursue a “just peace” – a framework the Ukrainian leader chafed against.

“For me as president, ‘just peace’ is no compromise,” Zelenskyy said. He said the war would end when Ukraine’s sovereignty, freedom and territorial integrity were restored, and Russia had reimbursed Ukraine for all damage inflicted by its forces.

“There can be no ‘just peace’ in the war that was forced upon us,” he added.