Here's a surprise: Oil is back in bull market territory.

U.S. crude futures have increased 22% since June, a comeback that has pushed prices to around $52 a barrel.

It's welcome news for OPEC, which has been trying to squeeze excess supply out of the market as it recovers from a dramatic price collapse in 2014.

There are two major factors helping to drive crude higher:

Threats in the Middle East

Major oil deposits sit beneath land in northern Iraq that is currently administered by the semi-autonomous Kurdistan Regional Government.

The Kurds, who have long sought a country of their own, cast ballots on Monday in a controversial independence referendum. The move has angered both Turkey and Iraq.

Recep Tayyip Erdogan, the president of Turkey, has threatened to close the pipeline that carries oil from northern Iraq to the Turkish port of Ceyhan.

"We have the valve. And the minute we shut it down, that's done," Erdogan said in a speech on Monday.

He returned to the theme on Tuesday, saying that military action was possible if Kurds don't back away from independence plans. Turkey has a sizable Kurdish minority population.

The Kurdistan region of Iraq produces around 650,000 barrels per day, 85% of which goes through Turkish pipelines, according to FXTM.

"If the Turks decided to cut crude flows, it would create a shock which markets are currently pricing in," said Hussein Sayed, chief market strategist at FXTM.

"I think this is going to be only a temporary threat, given that independence will not happen overnight and OPEC members will quickly cover the shortage," he added.

Market balance

OPEC other major suppliers agreed in November to slash their production levels in order to support prices.

There had been chatter that OPEC would extend the cuts beyond their current expiration date of March 2018, but that has failed to materialize.

Even so, there are signs that the market is now coming into balance.

OPEC said Friday that its coalition recorded its highest level of compliance to date in August. And demand is strengthening.

The International Energy Agency says that demand grew very strongly in the second quarter, especially in developed economies. The agency upped its demand growth estimate for 2017 to 1.6 million barrels per day.