Light, sweet crude for July delivery rose 41 cents to settle at $127.76 a barrel on the New York Mercantile Exchange. Earlier Monday, oil futures fell nearly $10 below a trading record of $135.09 reached May 22.
In London, July Brent crude was also higher.
At the pump, the national average price of a gallon of regular gas was unchanged at $3.975, according to a survey of stations by AAA and the Oil Price Information Service, matching a record set Sunday.
Gas prices are up 1.3 cents a gallon since Friday, and may continue rising regardless of what oil futures do.
"If crude comes off, that will not necessarily translate into lower prices for gasoline at the pumps," said Linda Rafield, senior oil analyst at Platts, the energy research arm of McGraw-Hill Cos.
That's because gas supplies have been falling even as summer driving demand picks up. Demand is lower than it was this time last year, according to Energy Department data and a number of driver surveys in recent days. But gas is alwaysin higher demand over the summer than during the rest of the year.
Gas prices are already higher than $4 in many parts of the country, and average more than that in 12 states and the District of Columbia.
However, continued declines in oil prices would remove one of the reasons gas prices are near $4 on a national basis. And that could lead to lower prices as the summer wears on. Gasoline typically peaks in price near Memorial Day, then declines over the summer.
Crude futures followed heating oil higher Monday on concerns about supplies exacerbated by temporary outages at a couple of refineries in Europe, analysts said. Heating oil is closely related to diesel fuel, which is in tight supply globally. July heating oil futures rose 5.53 cents to settle at $3.722 on the Nymex.
But investors also reacted to reports that Iran's top Organization of Petroleum Exporting Countries official said there is no need for a special OPEC meeting to discuss raising output, said Phil Flynn, an analyst at Alaron Trading in Chicago.
Flynn said oil futures also rose in sympathy with natural gas futures, which soared as high temperatures in many parts of the country raised demand from utilities that use natural gas to generate electricity. July natural gas futures rose 26.6 cents to settle at $11.969 per 1,000 cubic feet.
"Natural gas seems to be leading the way here a little bit," Flynn said.
Amid Monday's price increases, new data from the Commodity Futures Trading Commission suggests large speculators reduced their long-term, or "net long" investments in Nymex crude futures by 48 percent during the week that ended May 27, said Addison Armstrong, director of market research at Tradition Energy in Stamford, Conn., in a research note.
"The net-long position held by this group of traders is now at the lowest level since the beginning of September of last year," Addison said.
Speculative buying has been cited as a major reason behind oil's more than doubling its price in a year.
In other Nymex trading, July gasoline futures rose 4.25 cents to settle at $3.3907 a gallon. Gasoline futures were supported by temporary outages at two domestic refineries.