Oil prices rebounded on Wednesday, snapping three straight sessions of decline, as falling U.S. crude inventories and growing supply risks from wildfires in Canada boosted prices.

Brent crude futures for September rose 40 cents, or 0.5%, to $81.41 a barrel by 0650 GMT. U.S. West Texas Intermediate crude for September also increased 40 cents, or 0.5%, to $77.36 per barrel.

WTI had lost 7% over the previous three sessions, while Brent shed nearly 5%.

U.S. crude oil, gasoline and distillate inventories fell for the fourth straight week in the previous week, according to market sources citing the American Petroleum Institute (API), reflecting steady demand in the world's largest consumer of oil.

Wildfires in Canada were also supporting prices. The fires have forced some producers to curtail production and were threatening a large amount of supply, ING analysts said.

"Market is nearing oversold territory and we still believe that the fundamentals support prices moving higher from current levels over the remainder of the third quarter on the back of a deficit environment," ING analysts said in a note.

The API figures showed crude stocks falling by 3.9 million barrels in the week ended July 19, the sources said, speaking on condition of anonymity. Gasoline inventories fell by 2.8 million barrels and distillates shed 1.5 million barrels.

That would be the first time crude stocks in the United States fell for four weeks in a row since September 2023.

Official government data on oil inventory data is due for release on Wednesday.

Oil prices fell to a six-week low on Tuesday, with Brent closing at its lowest level since June 9 on ceasefire talks between Israel and Hamas in a plan outlined by U.S. President Joe Biden in May and mediated by Egypt and Qatar.

Prices also suffered due to continued concern that the economic slowdown in China, the world's biggest crude importer, would weaken global oil demand.

(Reporting by Laila Kearney in New York and Sudarshan Varadhan in Singapore; Editing by Christopher Cushing, Miral Fahmy and Sherry Jacob-Phillips)