Crude oil futures posted their third consecutive weekly loss on Friday as the bulls that pushed oil prices to nearly four-year highs head into retreat.

U.S. West Texas Intermediate crude ended this week down 2.2 percent and has now tumbled about 12 percent from its recent high of $86.74 on Oct. 3. Brent crude, the international benchmark for oil prices, fell 2.7 percent this week and is down 10.5 percent from its Oct. 3 high of $86.74.

Crude futures have gotten swept up in a wider stock market rout this month, with most of the losses for oil coinciding with a sell-off in equities. But the narrative driving oil prices has also flipped in recent weeks, and traders are closing out bullish bets on the commodity.

At the start of October, oil prices were rising on signs that U.S. sanctions are shrinking Iran's crude exports faster than anticipated, potentially leaving the world with a shortage of oil. The sanctions are expected to cut crude exports from Iran, OPEC's third-biggest oil producer, by about 1 million barrels per day.

But concerns about faltering demand and rising output from OPEC and Russia now have traders focused on potential oversupply.

"The narrative about the supply crunch with Iran got offset by this burst of supply that came on the market from OPEC and Russia and Saudi Arabia," said John Kilduff, founding partner at energy hedge fund Again Capital.

Saudi Arabia says it hiked output to 10.7 million barrels per day in October and will increase production to 11 million bpd next month. Meanwhile, Russia says it pumped at a post-Soviet-era peak of 11.36 million bpd in September. The 15-nation OPEC group also managed to increase its collective output last month, despite supply declines in Iran and Venezuela.

Forecasters have also been tempering their outlook for growth in global oil consumption due to trade tensions, high oil prices and currency weakness in some emerging markets.

Hedge funds and money managers are now liquidating their long positions in oil, or bets that the commodity price will keep rising.

"The long side of the equation has been bailing out," said Kilduff.