* Erdogan warns northern Iraq oil exports at risk over referendum
* Punitive measures involving border, air space in offing -PM
* New restrictions on traffic over key Habur border crossing (Adds militant attacks)
By Umit Bektas and Ece Toksabay
HABUR, Turkey, Sept 25 (Reuters) - Turkish President Tayyip Erdogan threatened on Monday to cut off the pipeline that carries oil from northern Iraq to the outside world, intensifying pressure on the Kurdish autonomous region over its independence referendum.
Erdogan spoke shortly after Prime Minister Binali Yildirim said Ankara could take punitive measures involving borders and air space against the Kurdistan Regional Government (KRG) over the referendum and would not recognise the outcome.
Voting began on Monday despite strong opposition from Iraq's central government and neighbouring Turkey and Iran - both with significant Kurdish populations - as well as Western warnings the move could aggravate Middle East instability.
Erdogan, grappling with a long-standing Kurdish insurgency in Turkey's southeast, which borders northern Iraq, said the "separatist" referendum was unacceptable and economic, trade and security counter-measures would be taken.
He stopped short of saying Turkey had decided to close off the oil flow. Hundreds of thousands of barrels of oil a day come through the pipeline in Turkey from northern Iraq, but he made clear the option was on the table.
"After this, let's see through which channels the northern Iraqi regional government will send its oil, or where it will sell it," he said in a speech. "We have the tap. The moment we close the tap, then it's done."
Yildirim said Ankara would decide on punitive measures against the Kurdistan Regional Government (KRG) after talks with Iraq's central government.
"Our energy, interior and customs ministries are working on (measures). We are evaluating steps regarding border gates and air space. We will take these steps quickly," Yildirim told Turkish broadcasters.
Iraqi soldiers arrived in Turkey on Monday night to join a drill on the Turkish side of the border near the Habur area in the southeast, Turkey's military said in a statement. Iraq's defence ministry said the two armies started "major manoeuvres" at the border area.
Local media said Turkey had blocked access to the KRG via the Habur border crossing with Iraq. Ankara's customs minister denied this, saying Habur remained open but with tight controls on traffic, according to the state-run Anadolu agency.
However, Erdogan later said traffic was only being allowed to cross from the Turkish side of the border into Iraq.
Maruf Ari, a 50-year-old truck driver, was one of those who had crossed back into Turkey early on Monday morning. He said a closure of the gate would ruin his livelihood.
"If the border is closed it will harm all of us. I'm doing this job for 20 years. I'm not making a lot of money. Around 1,000 lira ($285) a month. But if the gate is closed, we will go hungry."
The United States and other Western powers also urged authorities in the KRG to cancel the vote, saying it would distract from the fight against Islamic State.
Shares of Turkish Airlines, which has direct flights to northern Iraq, tumbled 6.5 percent, underperforming a 1.78 percent decline in the BIST 100 index. Turkey's currency, the lira, also weakened.
Turkey took the Kurdish television channel Rudaw off its satellite service TurkSat, a Turkish broadcasting official told Reuters.
Turkey has long been northern Iraq's main link to the outside world, but sees the referendum as a grave matter for its own national security. Turkey has the region's largest Kurdish population and has been fighting a three-decade insurgency in its mainly Kurdish southeast.
On Saturday, Turkey's parliament voted to extend by a year a mandate authorising the deployment of troops in Iraq and Syria.
Still, Ankara is unlikely to make rash moves when it comes to sanctions against the KRG, said Nihat Ali Ozcan, a professor of political science and international relations at TOBB University of Economics and Technology.
"Closing the border gate, cancelling international flights and, at the final step, cutting the pipeline can be discussed," he said. "Military pressure can be used directly or indirectly."
The Turkish army launched military exercises involving tanks and armoured vehicles near the Habur border crossing a week ago and they are expected to continue until at least Sept. 26. Additional units joined the exercises as they entered their second stage
Turkey's military said in its statement that the third phase of the drill would be held on Sept. 26, and that Iraqi soldiers who arrived on Monday night would join.
The military has also in recent days carried out daily air strikes against Kurdistan Workers Party (PKK) targets in northern Iraq, where the group's commanders are based.
The PKK launched its separatist insurgency in 1984, and more than 40,000 people have been killed since. It is designated a terrorist group by Turkey, the United States and European Union.
Militants in northern Iraq launched a cross-border mortar attack into Turkey's Hakkari province, hitting a temporary residence used by refugees, the interior ministry said. One refugee was killed and several others were injured, it said.
In the eastern Agri province, near the border with Iran, individuals thought to be Kurdish militants opened fire on a mini-bus carrying foreign nationals, the ministry said. Three people were killed and four wounded in that attack, it said. ($1 = 3.5153 liras) (Additional reporting by Tulay Karadeniz, Dirimcan Barutin and Gulsen Solaker in Ankara and Ezgi Erkoyun in Istanbul; Writing by Daren Butler and David Dolan; Editing by Mark Heinrich, Larry King/Jeremy Gaunt)