ISTANBUL/KARKAMIS, Turkey (Reuters) - Turkish forces will remain in Syria for as long as it takes to cleanse the border of Islamic State and other militants, Prime Minister Binali Yildirim said on Friday, after a truck bombing by Kurdish insurgents killed at least 11 police officers.

The suicide attack at a police headquarters in a province bordering Syria and Iraq came two days after Turkey launched its first major military incursion into Syria, an operation meant to drive Islamic State out of the border area and stop Kurdish militias from seizing ground in their wake.

U.S. Secretary of State John Kerry and Russian Foreign Minister Sergei Lavrov meanwhile tried on Friday at a meeting in Geneva to finalize an agreement on fighting Islamist militants in Syria. Such a deal could in theory pave the way for a political transition to end the five-year conflict.

Turkey, a NATO member and part of the U.S.-led coalition against Islamic State, has seen a series of deadly bombings this year blamed on the radical Islamists. But it also fears Kurdish militias in Syria will seize a swathe of border territory and embolden Kurdish insurgents on its own soil.

President Tayyip Erdogan said the bombing in Sirnak province would increase Turkey’s determination as it fights terrorist groups at home and abroad. Yildirim said there was no doubt the Kurdistan Workers Party (PKK), which has waged a three-decade insurgency for Kurdish autonomy, was responsible.

“From the beginning we have been defending Turkey’s territorial integrity. We are also defending Syria’s territorial integrity. The aim of these terrorist organizations is ... to form a state in these countries... They will never succeed,” Yildirim told a news conference in Istanbul.

“We will continue our operations (in Syria) until we fully guarantee security of life and property for our citizens and the security of our border. We will continue until Daesh (Islamic State) and other terrorist elements are taken out.”

After he spoke, the PKK claimed responsibility for the attack on the police headquarters, according to a website affiliated to the group.

Syria has condemned the Turkish operation, codenamed “Euphrates Shield”, as a breach of its sovereignty. Turkish special forces, tanks and jets launched the incursion in support of Syrian rebels, mostly Turkmen and Arab, who quickly took the border town of Jarablus from Islamic State on Wednesday.

An alliance of 23 Kurdish parties in Syria also condemned the Turkish operation on Friday. In a joint statement, they called for a complete withdrawal of all Turkish forces from the country and accused Ankara of trying to occupy Syria under the pretence of fighting terrorism.

Turkish military vehicles shuttled in and out of Syria on Friday, Reuters witnesses said, including a construction machine that helped flatten the route for a tank. Controlled explosions rang out around the Karkamis border crossing as Turkish security forces removed mines and booby traps left by Islamic State.

Ismail Metin, the commander of Turkey’s second army responsible for the borders with Syria and Iraq, visited Jarablus on Friday, local sources said.

WEEKS OR MONTHS

Turkey has shown little sign so far of a quick withdrawal. U.S. Vice President Joe Biden, who met Erdogan in Ankara on Wednesday, said Turkey was ready to stay in Syria for as long as it takes to destroy Islamic State.

A Syrian rebel commander in charge of one of the main groups involved in the Turkish-backed operation told Reuters the forces now aimed to move westward after taking Jarablus, an advance that could take weeks or months to complete.

Colonel Ahmad Osman, speaking to Reuters from Jarablus, said the priority was now to advance about 70 km (40 miles) west to Marea, a town where rebels have long had a frontline with Islamic State.

Turkey has long lobbied for a “buffer zone” in northern Syria controlled by what it regards as moderate rebels, potentially in border territory currently held by Islamic State and stretching about 80 km (50 miles) west of Jarablus.

Slideshow ( 4 images )

Sweeping out Islamic State would deprive the group of a smuggling route taken by foreign fighters joining its ranks, and could also create a safe area for displaced civilians and help to stem the flow of refugees, Turkish officials have said.

They argue the proposal has become all the more urgent since Ankara began implementing a deal with the European Union to stop illegal migration earlier this year.

“The situation in Syria and Iraq is getting worse,” Yildirim told a joint news conference with the visiting prime minister of Bulgaria, which has also been struggling to slow migrant flows.

“We’re cleansing Islamic State and other terrorist elements (in northern Syria) so people living there are not forced to leave their homes. But the problem has to be comprehensively handled at the EU level. Solutions are needed quickly.”

Slideshow ( 4 images )

Syria’s war has killed at least a quarter of a million people and forced almost five million to flee the country, many of them to Turkey. The United Nations estimates that 6.5 million are internally displaced.

An agreement was reached on Thursday to evacuate around 4,000 civilians and 700 fighters from the besieged Damascus suburb of Daraya, ending one of the conflict’s longest stand-offs. Syrian Arab Red Crescent (SARC) vehicles entered the area to prepare for the evacuation on Friday.

Syria’s army has surrounded rebels and civilians and blocked food deliveries in Daraya since 2012, regularly bombing the area, one of the first places to see peaceful protests against President Bashar al-Assad.

Erdogan, who wants to see Assad removed from power, spoke by phone on Friday with Russian President Vladimir Putin, who backs the Syrian leader, and they stressed the importance of a joint fight against terrorism, the Kremlin said.

OVERLAPPING INTERESTS

The suicide bombing in Turkey’s southeastern town of Cizre is another reminder of the risks Ankara faces as its gets drawn ever more deeply into Syria’s conflict, with the threat of reprisals from both Islamic State and Kurdish insurgents.

The provincial governor’s office said 11 police officers were killed and 78 people, three of them civilians, wounded.

Large plumes of smoke billowed from the blast site. Photographs showed a large three-storey building reduced to its concrete shell, with no walls or windows, surrounded by rubble.

Turkey views the PKK, listed as a terrorist organization by Turkey, the United States and the European Union, as closely linked to the Syrian Kurdish YPG militia. Washington, however, has backed the YPG in a separate campaign against Islamic State in northern Syria.

Turkish troops fired on YPG fighters south of Jarablus on Thursday, highlighting the cross-cutting of interests of two pivotal NATO allies.

The Cizre attack came as Turkey has been weakened by a failed July 15 military coup. More than 1,700 military personnel have been removed for their alleged role in the putsch, including some 40 percent of admirals and generals, raising concern about the NATO member’s ability to protect itself.

Deputy Prime Minister Numan Kurtulmus said on Twitter that Islamic State, the PKK and the Syrian Kurdish YPG militia were all attacking to take advantage of the failed coup.