MADRID — President Biden issued a grim warning to Americans after Russian troops invaded Ukraine in February: standing up to President Vladimir V. Putin could hurt the U.S. economy. “I will not pretend this will be painless,” he said in remarks delivered in the East Room of the White House.
But few in Mr. Biden’s administration imagined just how much domestic political and economic pain could come from the grinding war in Ukraine’s east: growing anger about $5 a gallon gasoline, deepening frustration over rising food costs and rents, and rising opposition to spending billions of dollars on a foreign conflict with no end in sight.
In meetings of the Group of 7 nations and NATO this week in Europe, Mr. Biden and his allies hammered home the idea that they must stand united against Russia while drawing new and firmer lines against what they see as predatory economic practices by China.
But the gatherings also underscored the war’s deep strains on Western leaders and consumers from energy costs that have soared as a result of severe sanctions imposed on Russia and that could climb higher still.
For all the steps that Mr. Biden and his allies took to counter Russian aggression — including a fast path to NATO admission for Finland and Sweden and a plan to cap the price of Russian oil exports — the leaders failed to describe the endgame in the long war of attrition.
Mr. Biden is already feeling political heat from his swift response to the Ukraine invasion. His push to ban Russian oil imports shortly after the invasion was followed by global price spikes, which have sapped consumer confidence and threatened the Democrats’ hold on Congress in the coming midterm elections. Republicans have tried to blame the president’s policies on energy and climate, but the invasion and the West’s response to it are the prime reasons for the surge.
If the war drags on and Mr. Biden fails in his plan to keep Russian oil flowing at a severe discount, some analysts say that oil prices could skyrocket toward $200 a barrel, which could mean $7 a gallon gas or more — prices that, if they held, would severely damage Mr. Biden’s re-election hopes.
An extended conflict would also require the United States and its allies to find additional money for military and other aid to Ukraine, on top of the $40 billion that Congress has already approved this year. For now, it is just a small group of opponents questioning the spending, but that discontent could spread, providing a line of attack for former President Donald J. Trump, who is signaling plans for a rematch with Mr. Biden in 2024.
Those currents make the next several months crucial for Mr. Biden and his emboldened international coalition — a fact that administration officials have begun to acknowledge. Mr. Biden’s national security adviser, Jake Sullivan, told reporters on the sidelines of the G7 meetings in the German Alps that allies would attempt to help Ukraine’s outgunned forces gain as much leverage in the war as possible before winter, because “a grinding conflict is not in the interest of the Ukrainian people, for obvious reasons.”
Mr. Sullivan and Treasury Secretary Janet L. Yellen said this week that officials would move quickly to negotiate and implement the myriad unresolved details of the proposed cap on the price of Russian oil exports, promising there would be relief for drivers at the gasoline pump if it is put in place. But many economists and energy experts doubt that a cap, which has never been tried on a global scale like this, could come together effectively anytime soon. Privately, some administration officials concede that it could take until late fall, or longer.
European leaders have more publicly wrestled this week with the pain of the war for their citizens, particularly the availability and price of energy. But in a few limited speeches in Germany and Spain, Mr. Biden has expressed only a steely resolve in the cause of deterring Mr. Putin’s aggressions.
Asked in a news conference at the end of the NATO summit in Spain how long American drivers could expect to continue paying higher gasoline prices, Mr. Biden was blunt.
“As long as it takes,” he said, “so Russia cannot in fact defeat Ukraine and move beyond Ukraine.”
Mr. Biden also said he expected that his oil cap plan would help consumers. “We think it can be done,” he said. “It will drive down the price of oil, and it will drive down the price of gasoline as well.”
Data released by the Commerce Department on Thursday showed that prices affected by the war, such as those for food and energy, continued to surge in May, while the growth rate of other prices leveled off. Mr. Biden blamed Mr. Putin.
“The reason why gasoline prices are up is because of Russia,” he said at the news conference.
At least some temporary relief could be on the way for American motorists. The average national price has dipped slightly in recent weeks, and future contracts to buy gasoline have declined much more significantly, suggesting gas stations may be reducing prices in July. But many analysts say they think prices could surge again later this year, as Europe’s ban on Russian oil imports takes effect, unless Mr. Biden’s price cap plan succeeds.
The president’s focus this week on the war, energy price inflation and the looming threats from China came at the exclusion of many of the issues that dominated his 2020 campaign — and the current controversies animating his party back home.
He and his fellow leaders rarely mentioned the Covid-19 pandemic. Mr. Biden’s sprawling — and stalled — plans for new social programs were sidelined. Even climate change has been mostly relegated to lofty promises in public forums rather than concrete pledges of action.
Proposing a price cap is just the latest example of Mr. Biden grasping for solutions to the consumer pain caused by the war.
Top officials have also reached out to Venezuela — a Russian ally that has been under U.S. sanctions for years — about the oil supply crunch. The administration has also sought help from President Recep Tayyip Erdogan of Turkey to move grain out of Ukraine to help ease food shortages.
And next month, Mr. Biden is traveling to Saudi Arabia and will meet personally with Crown Prince Mohammed bin Salman, after repeatedly calling on the Saudis and other large oil producers to increase production. Mr. Biden was asked on Thursday if he would press the de facto Saudi ruler in person for an increase, despite once condemning the prince as a “pariah” because of the brutal assassination of Jamal Khashoggi, a Saudi dissident, in 2018. Mr. Biden said that he would not.
Nonetheless, the imperative to respond to the rippling effects of the war has led Mr. Biden to at least consider what once would have been unthinkable. That underscores the reality for the president and his allies: There are few solutions to the current situation that don’t come with downsides.