President Obama said Thursday that there are no “quick fixes” for rising gasoline prices that are threatening the economic recovery and providing fodder for attacks from his political rivals.

Gas prices have risen 29 cents per gallon since December, with regular-grade gas now averaging $3.64 a gallon in the Washington region at a time of year when consumers usually enjoy a respite from price hikes.

The high cost at the pump could turn into an election-year mess for the president, whose approval ratings have surged recently as the economy improved. Republicans, sensing an opportunity, have blamed Obama for not giving oil companies greater freedom to drill for new U.S. supplies that might ease prices.

The political dynamics are muddied by the Iran factor. In their debate Wednesday, the leading GOP presidential candidates vowed to prevent Iran from acquiring a nuclear weapon. Yet the rise in oil prices recently has been augmented by the tightening of U.S. and European sanctions on Iran and its oil exports.

Some Democrats are also urging Obama, who has pressured other nations to curtail purchases of Iranian oil, to protect consumers by releasing oil from the Strategic Petroleum Reserve, as he did during the Libyan conflict last summer. Most presidents are reluctant to tap the reserve without a dire emergency, and many experts believed the release last year had a fleeting impact on gas prices.

The recent climb in pump prices resembles the 2008 oil spike, when, as a presidential candidate, Obama used the increase to rally support for a renewable-energy agenda. Since then, oil prices have collapsed with the economy and then soared again with the recovery. U.S. oil and gas production has begun increasing substantially for the first time in more than two decades. But the United States still imports about half of its petroleum needs.

In an appearance Thursday at the University of Miami, where he toured an engineering program for energy efficiency, Obama told a crowd of hundreds of students that his GOP rivals who are pledging to slash prices are “rooting for bad news” to win political points.

“Since it’s an election year, they’re already dusting off their three-point plans for $2 gas. I’ll save you the suspense: Step one is drill, step two is drill, and step three is keep drilling,” Obama said. “Well, the American people aren’t stupid. You know that’s not a plan. . . . It’s a strategy to get politicians through an election. You know there are no quick fixes to this problem, and you know we can’t just drill our to lower prices.”

Obama argued that his “all of the above” energy policy — promoting increased domestic production, improved fuel-efficiency standards for vehicles and greater investment in clean energy innovation — is the smartest way to insulate the United States from the vagaries of the global oil market.

“There is no silver bullet. There never has been,” Obama said. “It’s the easiest thing in the world to make phony election-year promises about lower gas prices.”

Many oil experts say Obama has altered his tone since 2008. “There has been an evolution in his energy thinking,” said Frank A. Verrastro, director of the energy program at the Center for Strategic and International Studies. “He can still pick up the transformative, clean, green theme, but there is a recognition that oil and gas has been a big economic driver.”

Obama’s position reflects the White House’s belief that gasoline prices are subject to cyclical spikes due to forces largely outside its control, including the rise in Chinese and Indian oil demand.

That view hasn’t stopped Obama’s rivals from trying to exploit the matter on the campaign trail. This week, GOP presidential candidate Rick Santorum blamed Obama’s “radical environmental policies” for the higher prices, suggesting Obama purposely aims to keep prices high to stave off global warming by discouraging people from driving. Newt Gingrich said the president “has been outrageously anti-American-energy.”

And the Republican National Committee released a Web video Thursday that features a clip of Obama’s impromptu singing of “Sweet Home Chicago” during a White House blues concert behind a chart showing gas prices rising from $1.85 per gallon when he took office in 2009 to $3.59 this month. The ad is titled “Obama’s Got America Singing the Blues.”

Domestic oil and gas companies also are unhappy. Jack Gerard, president of the American Petroleum Institute, said Wednesday that Obama’s corporate tax reform plan, which proposes cuts in tax breaks for oil and natural gas companies, would dampen domestic production.

Gerard cited the Obama administration’s rejection of the Keystone XL oil sands pipeline, which would have carried oil from Canada to refineries in Texas, as evidence that the White House is more interested in placating environmentalists.

“When the president talks about ‘all of the above’ to describe his policy, unfortunately he leaves out the oil and natural gas industry,” Gerard said. “If you look at the policies he’s advanced for oil and natural gas, everything has been done to discourage domestic production.”

But energy experts say many Republican proposals, such as building the Keystone pipeline, would have little near-term impact on gasoline prices. Companies producing in Canada’s oil sands area and pipeline companies say that there is enough spare pipeline capacity to last until 2016, or longer.

The Obama administration notes that domestic production has increased every year the president has been in office. During his State of the Union speech last month, Obama said American oil production “is the highest that it’s been in eight years.”

On Thursday, he reiterated calls for new investments in clean energy innovation.

Administration officials said Obama plans to highlight other accomplishments Friday, including an historic fuel efficiency standards agreement reached last summer with the auto industry that would require cars to average 54.5 miles per gallon by 2025, which the administration estimates will save 12 billion barrels of oil.

Obama chose the University of Miami for his speech because it offers an industrial energy-efficiency program for engineers. He also planned to hold four fundraisers in Miami and Orlando after his appearance.

Jay Hakes, who worked on energy policy in the Carter and Clinton administrations, has studied how past administrations have responded to gas price hikes. While oil output has boosted by policies put in place before Obama took office, Hakes said, “I do not know how you could make the point that he somehow restrained production when both onshore and offshore [output] have a lot of momentum behind them.”