NEW YORK — Oil prices fell Tuesday, giving up an earlier advance as the dollar held its gains against the euro and the Energy Department slashed its oil consumption projections. Retail gasoline prices rose to a record over $4.04 a gallon.

The dollar rose on recent supportive comments by U.S. officials, prompting selling by investors who had bought commodities such as oil as a hedge against inflation. Also, a stronger dollar makes oil more expensive to investors overseas.

The Energy Department, in a monthly report, indicated that high prices are cutting oil consumption more than expected in the industrialized world. Consumption is now expected to fall by 240,000 barrels a day in 2008. Last month, the department forecast consumption would be unchanged from 2007 levels.

That report calmed a market that earlier sent oil up more than $3 on a projection by the International Energy Agency that said global demand will continue to rise, especially in China.

Light, sweet crude for July delivery fell $3.04 to settle at $131.31 a barrel on the New York Mercantile Exchange.

A weekly report from MasterCard offered additional evidence that high prices are cutting gas consumption: MasterCard's SpendingPulse survey found that demand for gasoline fell 3.8 percent last week compared to the same week last year and is off 5.2 percent, on average, over the last four weeks compared to the same period of 2007.

Reports that Saudi Arabia has increased oil output by 500,000 barrels a day this quarter, 200,000 barrels a day more than previously thought, added some pressure to the market. Still, analysts said the Saudi move was only a peripheral factor in Tuesday's price drop.

"A couple hundred thousand barrels just isn't enough," said Jim Ritterbusch, president of energy consultancy Ritterbusch and Associates in Galena, Ill. "The main item here today is the dollar strengthening."

Meanwhile, the IEA, in its own monthly report, cut its demand growth forecasts, projecting that global demand for petroleum products such as gasoline, diesel and heating oil will grow by 0.9 percent, or 800,000 barrels a day, in 2008. That's down from the 1.2 percent, or 1 million barrels, the IEA forecast earlier this year.

However, the IEA, an energy adviser to Western industrialized nations, also said demand for fuel for reconstruction work in the aftermath of May's earthquake will boost Chinese oil demand by 5.5 percent this year, a slightly higher forecast than in previous reports.

"A 5.5 percent increase in one of the largest consumers of oil in the world is a lot of barrels of oil," Ritterbusch said.

But the gains were difficult to sustain in the face of a stronger dollar, analysts said.

"You don't get a lot of ... additional buying when the dollar is strong," Ritterbusch said.

Gas prices, meanwhile, advanced another 2 cents into record territory Tuesday, reaching a new record national average of $4.043, according to a survey of stations by AAA and the Oil Price Information Service. Gas prices are following crude futures higher and aren't likely to stop rising until crude prices peak.