Hedge funds ditched energy stocks last week for the first time in three weeks, despite a rally in oil prices triggered by the prospect of a widening supply deficit, Goldman Sachs said in a report.

The move, according to the bank's prime brokerage unit, was mainly led by short sales, meaning that hedge funds were speculating on a decline in energy stocks' prices. The bank said sales occurred in both North America and Europe.

Goldman Sachs, as one of the biggest providers of lending and trading services to investors through its prime brokerage unit, is able to track hedge funds' investment trends.

Overall, Goldman Sachs said hedge funds' trading book was underweight energy stocks at levels approaching a May 2020 low. It added hedge funds increased their short bets on U.S. energy stocks, besides oil, gas, consumable fuels and energy equipment and services.

Earlier this month, Saudi Arabia and Russia extended a combined 1.3 million barrels per day of supply cuts to the end of the year, spurring predictions that benchmark Brent crude prices could surpass $100 a barrel this year.

However, China's sluggish post-pandemic economic recovery has also raised concerns that demand may slow down.

(Reporting by Carolina Mandl in New York and Nell Mackenzie in London Editing by Mark Potter)