Turkish troops fired tear gas and water cannons Monday to disperse crowds near Suruc, Turkey, on the Syrian border, where Turkish and Syrian Kurds have been demonstrating against border closings and the Islamic State’s latest advances in Syria.

At least 130,000 refugees have poured into Turkey in the past three days, fleeing the onslaught of the militants.

The militants have taken more than 60 villages in recent days as they push toward the border town of Ayn al-Arab, or Kobane in Kurdish. Taking Kobane would give the militants control of a large stretch of the Syrian-
Turkish frontier — and another potential route for Islamic State recruits to enter Syria.

“An uncontrollable force at the other side of the border is attacking civilians,” Numan Kurtulmus, a Turkish deputy prime minister, said of the Islamic State group.

While it seems that Turkey would have the most to lose if the Islamic State expanded its control of this frontier, Ankara has taken little action, instead preventing Turkish Kurdish fighters from entering Kobane to help with its defense, according to Syrian Kurds.

Hundreds of men from the Turkish Kurdistan Workers’ Party (PKK) have tried to cross into Syria. “Turkey is preventing not only PKK but all Kurdish men from entering Syria,” said Redur Xelil, a spokesman for the People’s Protection Units (YGP), one of the Syrian Kurdish groups fighting the Islamic State. “But the men are entering illegally through some crossings.”

The Turkish government says it is illegal for fighters to enter Syria through its borders, but hundreds of foreign combatants have transited through Turkey in the past three years to join the war against Syrian President Bashar al-Assad, who Turkey has said must go. That has led to accusations that Turkey has fostered the growth of the Islamic State. Turkey has denied this, but has a long history of conflict with the autonomy-seeking Kurds and has been battling its own Kurdish separatists for decades.

“The reality is that Turkey is siding with ISIS,” said Xelil, using the acronym for the group’s previous name, the Islamic State of Iraq and Syria.

Kurdish fighters managed to halt the militants’ advance Monday, but fierce fighting continued on several fronts. Syrian Kurdish forces say their weapons are no match for the militants’ arsenal, looted from fleeing Iraqi national troops in June. Kurdish leaders have been calling on the international community for support to defend the border against the militants, as well as for fighters from Turkey to join them and defend the Kurdish villages.

“Turkey does not have a problem with ISIS,” Xelil said. “Sometimes they facilitate the transit of their fighters and even open the hospitals for their injured, while they do not allow [our] injured to cross and use their hospitals.”

As Assad has battled to protect his regime in Damascus, the Syrian Kurds in the country’s north have taken the opportunity to increase their autonomy, much to Turkey’s dislike.

“The Turks are really happy seeing the Islamic State demolishing the political and administrative system, the self-governing system, that the Kurds were in the process of building in Kurdish areas in northern Syria,” said Hoshang Waziri, an Iraqi Kurdish analyst and writer who spent years in Syria. “Turkey much prefers an Islamic State neighbor over a semi-PKK-led Kurdish state.”

While Turkey is getting comfortable with the idea of an independent Iraqi Kurdish state — in part by building economic relations with the enclave — the Turks have seen autonomy for Syrian Kurds as a threat. Unlike the Iraqi Kurdish leadership, Syrian Kurds have a close relationship with the Turkish PKK Kurds who have been fighting Turkey for independence.

That could be changing as Turkey increasingly sees the threat posed by the expansionist Sunni militants of the Islamic State. Those leading the charge for the group’s self-declared caliphate have made it clear the borders now governing the Middle East are irrelevant to the militants.

Soner Cagaptay, director of the Turkish Research Program at the Washington Institute, says the fact that Ankara has looked the other way as Turkish Kurds slip across the border to fight with their brethren means this shift is already happening.

“I think we are going in that direction,” Cagaptay said. Despite a cease-fire and ongoing talks between PKK leaders and the Turkish government, Turkey still designates the group a terrorist organization.

However, decades of battles between the groups could be ended by the recognition of a common enemy, Cagaptay said. The Kurds are now a clear target, and Turkey would share a 500-mile border with the militants if the Kurdish enclaves fell to the Islamic State.

“There is only one element missing,” he said. “It would require the PKK to entirely end its fight against Turkey.”

Suzan Haidamous in Beirut and Brain Murphy in Washington contributed to this report.