Turkey has confirmed its military has attacked the main Kurdish force in northern Syria - a key ally of the United States in its efforts to defeat Islamic State (IS).

The Kurdish militia, known as the YPG, said the Turkish military shot at its forces deployed in the town of Tal Abyad twice on Sunday, using mostly machine guns.

No one was injured in the shooting and the Kurdish forces did not return fire. The YPG is the fighting force of the PYD, or the Kurdish Democratic Party.

Turkish prime minister Ahmet Davutoglu confirmed the military targeted the Kurdish forces.

He said: "We said the PYD will not go west of the Euphrates and that we would hit it the moment it did. We hit it twice.

"Turkey cannot abandon its border, its fate to any country."

The two reports seemed to conflict with each other, with Mr Davutoglu suggesting the Turkish forces had hit the Kurdish forces west of the Euphrates river while the YPG said the attack was in Tal Abyad, which is east of the river.

Turkey is wary of the PYD, which is affiliated with Turkey's Kurdish PKK rebels, who have waged an insurgency in south-eastern Turkey.

The Kurdish capture of the majority-Arab town of Tal Abyad, and its subsequent inclusion under the semi-autonomous enclave, has further irked the country.

The Kurdish forces have been a key ally for the US-led coalition fighting IS in Syria which Turkey is also a part of.

Turkey and the US, however, differ on whether the force is a terrorist organisation. Both countries have labelled the PKK as a terror group but only Turkey considers the Syrian Kurdish forces as terrorists.

Meanwhile, Turkish police have detained 71 people in raids against suspected IS militants in Istanbul and other cities, while the army said it caught 17 militants attempting to cross into Syria.

The sweep comes a day after police launched a series of operations against IS, including a raid on more than a dozen houses in the south-eastern city of Diyarbakir where seven militants were killed and 12 more captured.

Turkish authorities have extended operations against suspected IS cells after a double suicide bombing in Ankara this month that killed more than 100 people, the worst attack of its kind in Turkey's modern history. The bombing was blamed on the militant group.