Two years ago, just six days after the Russian invasion of Ukraine, President Biden opened his State of the Union address by vowing to stop Vladimir V. Putin in his tracks. The response in the House chamber was a series of standing ovations.

On Thursday night Mr. Biden again opened his address by repeating his warning that, if not stopped, Mr. Putin would not halt his territorial ambitions at Ukraine’s borders. But the political environment was completely different.

With many Republicans vowing not to vote for more aid and Ukrainians running short of ammunition and losing ground, Mr. Biden challenged them to defend former President Donald J. Trump’s declaration that if a NATO country failed to pay enough for its defense, he would tell Mr. Putin to “do whatever the hell you want.”

While Democrats cheered at Mr. Biden’s direct shot at his opponent in the 2024 election, many Republicans in the chamber looked down or checked their phones — an illustration of the shifting and multiplying challenges he faces at a moment when his foreign policy agenda is playing a central role in the re-election campaign.

Mr. Biden’s vow to restore American power by rebuilding alliances and to “prove democracy works” is a far more complicated task than it was when he came into office.

His problems run deeper than the new thinking of a Republican Party that has moved in 20 years from President George W. Bush’s declaration that America’s mission would be the spread of democracy to Mr. Trump’s open admiration of Mr. Putin and quasi-autocrats like President Viktor Orban of Hungary, who is visiting Mar-a-Lago on Friday.