Oil prices rose on Friday and finished the month higher, benefiting from news that U.S. oil output cuts in May were the largest on record.
Brent crude was up 24 cents, or 0.7%, at $43.18 a barrel. On Thursday, Brent closed 1.9% down after touching its lowest level since July 10.
West Texas Intermediate crude futures gained 35 cents, or 0.88%, to settle at $40.27 per barrel, after dropping 3.3% in the previous session.
Brent is on track for a fourth month of gains and U.S. crude is heading for a third as both rise from depths hit in April, when much of the world was in lockdown due to the coronavirus pandemic.
U.S. crude oil production plummeted in May, falling a record 2 million barrels per day to 10 million bpd, the U.S. Energy Information Administration said in a monthly report on Friday.
"After a bad day for big oil with terrible earnings, we're starting to see the impact in barrels," said Phil Flynn, an analyst at Price Futures in Chicago. "This suggests that we will see a tighter market in the future, and if the economy turns around we will have trouble meeting demand."
The dollar extended its dramatic fall on Friday and was on course for its biggest monthly drop in a decade after news on Thursday that U.S. gross domestic product collapsed at a 32.9% annualized rate - the steepest decline in output since records began in 1947.
Investors typically use dollar-denominated commodities as safe havens when the currency weakens.
"Global stimulus and a weak dollar will continue to support oil prices, as historically oil is seen as a hedge against inflation," said Keshav Lohiya, chief executive officer of consultancy Oilytics.
Globally, the economic outlook has dimmed again, with increasing coronavirus infections raising the risk of renewed lockdowns and threatening any rebound, according to Reuters polls of more than 500 economists.
Weaker refining margins around the world, lower Chinese oil demand and high crude inventories are putting further pressure on oil prices, Lohiya said.
Bjornar Tonhaugen, head of oil markets at Oslo-based Rystad Energy, said traders will next week closely monitor oil output increases by the Organization of the Petroleum Exporting Countries (OPEC) and its allies.
The group, known as OPEC+, collectively plans to increase production from Saturday, adding about 1.5 million barrels per day to global supply, after slashing output in the wake of the pandemic.