Crude oil futures climbed for a fourth straight day Friday and settled at a fresh six-week high, on anticipation of higher prices next week if progress is made this weekend in talks to raise the U.S. debt ceiling.

For the second day in a row crude topped $100-a-barel in intraday trading but couldn't hold triple digits at the settlement amid lingering doubts about the strength of near-term oil demand in the U.S., the world's largest oil consumer.

Top Treasury Department and Federal Reserve officials huddling Friday said they "remain confident" lawmakers will reach a deal to raise the $14.29 trillion debt ceiling by Aug. 2, even as they discussed the potential fallout if an accord can't be reached. The meeting came as the White House and top congressional leaders continue to seek a deal to raise the nation's borrowing authority before the deadline, after which Treasury officials have warned the U.S. could begin defaulting on obligations.

Gene McGillian, analyst and broker at Tradition Energy in Stamford, Conn., said there is "some optimism" on a debt deal that would improve the U.S. economic outlook. But he said real signs of economic recovery would be needed to for gains above $100 to hold.

Light, sweet crude oil for September delivery on the New York Mercantile Exchange settled 74 cents higher, at $99.87 a barrel, after hitting a high of $100.19 a barrel, the highest level since June 10. ICE September Brent settled up $1.41 at $118.67 a barrel.

Traders said fresh commodity-fund buying was evident, along with strong interest in August petroleum products ahead of the contract expiration next Friday. While U.S. demand for distillate fuels, such as diesel and heating oil remain sluggish, along with gasoline, demand from the export market remains strong. Heating oil futures prices are drawing interest as U.S. inventories of distillate fuel are 18.1 million barrels below year-ago levels, the biggest gap in eight years. Still analysts note that the shortfall comes against unusually high year ago levels, and inventories stand at 4.8% higher than the average for the last five years.

Expectations of lower near-term supplies of Nigerian crude oil helped fuel the rally, but gains were checked by expectations that U.S. crude stocks will be bolstered by the arrival of the first deliveries of the 30.64 million barrels of crude oil sold from the U.S. Strategic Petroleum Reserve. The Energy Department said 1.77 million barrels of crude were delivered as of Thursday, out of some 8.7 million barrels of the crude scheduled to be shipped by the end. The remaining 21.9 million barrels are scheduled for August delivery.

The market was buoyed by news Thursday that the International Energy Agency doesn't now plan a further oil sale beyond the current move, which released 60 million barrels into the market, the bulk of which came from the U.S. The IEA said the release, needed to cover oil supplies lost as a result of the ongoing Libyan civil war, and higher output from the Organization of Petroleum Exporting Countries, has improved the supply outlook for the second half of the year.

But those barrels will be arriving at refineries as demand for key petroleum products like gasoline remains weak amid rising prices in the peak summer demand season. U.S. data show demand of just over 9 million barrels a day in the week ended July 15 was more than 400,000 barrels a day below a year ago. AAA Daily Fuel Gauge reports said Friday the national average retail price for regular gasoline was $3.695 a gallon, up 2.8 cents from a week earlier.

"There are still a lot of near-term problems. Demand is sluggish. One has to wonder how sustainable is this," said Andy Lebow, a vice president at brokerage MF Global in New York.

August-delivery heating oil futures settled up 2.88 cents at $3.1280 a gallon, the highest level since June 9, while August reformulated gasoline blendstock futures were up 3.06 cents at $3.1301 a gallon.

--Michael R. Crittenden and Jared Favole contributed to this report.