“Step one is to drill, and step two is to drill, and then step three is to keep drilling,” he said.

This was the president’s first major effort to tackle an issue that has surfaced in the last few weeks as oil prices have been driven up by tensions in the Middle East, where Iran has threatened to retaliate against the West because of sanctions over its nuclear program.

Mr. Obama seemed keenly aware of the risk posed by oil prices. A previous cycle of price increases played briefly to the benefit of Senator John McCain during the 2008 campaign, when his running mate, Sarah Palin, revved up crowds with the chant, “drill, baby, drill.”

The president said that the United States is producing more oil now than at any time during the last eight years, with a record number of rigs pumping. The White House, he said, was prepared to open new areas in the Arctic Ocean and the Gulf of Mexico to exploration.

But Mr. Obama warned that no amount of domestic production could offset the broader forces driving up gas prices, chief among them Middle East instability and the ravenous energy appetite of China, which he said added 10 million cars in 2010.

“Anybody who tells you we can drill our way out of this problem doesn’t know what they’re talking about, or just isn’t telling you the truth,” he said to whoops from the crowd of nearly 1,500.