Jay Carney, the White House press secretary, declined to say whether the president would tap into the reserves if gas prices continued to rise. Speaking to reporters aboard Air Force One en route to New Hampshire, Mr. Carney maintained that the president was fixed on long-term solutions to the country’s oil dependence. Mr. Carney said oil companies “do not deserve and do not need” subsidies or tax breaks financed by taxpayers. He described the president as “very concerned” about the impact the spike in gas prices is having on American families.

Mr. Obama’s political advisers are concerned as well, and have indicated privately that Mr. Obama would have a tough time winning re-election if the price at the pump reached or exceeded $5 a gallon.

In New Hampshire on Thursday, Mr. Obama chided Republicans who he said were hoping to gain political advantage from the rise in oil prices. “Now I know this is hard to believe, but some politicians are seeing higher gas prices as a political opportunity,” Mr. Obama said. “You’re shocked, aren’t you? And right in the middle of an election year. Who would’ve thought?”

“Only in politics do people respond to bad news with such enthusiasm,” he said.

Appearing in North Dakota on Thursday, one of Mr. Obama’s Republican challengers, Mitt Romney, said the president was out of touch. North Dakota has benefited from the discovery of the Bakken Shale, an oil-rich deposit.

“Today the president is going to be in New Hampshire talking about energy in North Dakota,” Mr. Romney said. “He’s about as far away from North Dakota as he can get and still be in the United States. His idea of course is to be far enough away from the people who know what’s really going on right here to maybe try and blow one past folks.”

Republicans in Congress, struggling to regain their message as the economy improves, have latched on to rising oil prices and lobbed new accusations of culpability at the White House almost every day this week. But neither Republicans nor Democrats have been able to get legislative traction on their proposed solutions.