Turkey has launched its first major ground assault into Syria since the country's civil war began, sending in tanks and special forces backed by US airs strikes to help Syrian rebels retake a border town from so-called Islamic State (IS) militants.

The surprise incursion to capture the town of Jarablus was a dramatic escalation of Turkey's role in Syria's war - but its objective went beyond fighting extremists.

Turkey is also aiming to contain expansion by Syria's Kurds, who are also backed by the US and have used the fight against IS and the chaos of the civil war to seize nearly the entire stretch of the border with Turkey in northern Syria.

That raises the potential for explosive friction between two American allies.

US vice president Joe Biden flew into Ankara hours after the offensive and backed Turkey with a stern warning to the Kurds to stay east of the Euphrates River, which crosses from Turkey into Syria at Jarablus.

He said Kurdish forces "must move back across the Euphrates River. They cannot, will not, under any circumstance get American support if they do not keep that commitment".

A senior Turkish official said operations would continue until "we are convinced" imminent threats to Turkey are neutralised.

He said the aim is to create a "terror-free zone" in northern Syria to prevent militants from entering Turkey.

The Turkish assault began at around 4am local time with a furious barrage by artillery and war planes.

Then around 20 Turkish tanks, a team of Turkish special forces, and hundreds of Syrian rebels surged across the border, according to Turkish media and Syrian opposition activists.

Hours later, the rebels burst into Jarablus, posting photos from the town centre. IS militants withdrew apparently without a fight, retreating to the IS-held town of al-Bab further south.

In the evening, Turkish president Recep Tayyip Erdogan announced that rebels had retaken the city, saying they seized "government and official residences".

He spoke alongside Mr Biden, who said Washington backed the offensive with air strikes, adding, "We believe very strongly that the Turkish border should be controlled by Turkey."

Turkey has been deeply concerned by the advances along the border of the main US-backed Syrian Kurdish militia, known as the People's Protection Units, or YPG, fearing it is setting up a Kurdish entity. The YPG is also linked to Kurdish rebels waging an insurgency in south-eastern Turkey.

Jennifer Cafarella, an analyst with the Institute for the Study of War, said Turkey is trying to "block the ultimate creation of a contiguous zone of territorial control under the authority of the PYD," using the acronym for the Democratic Union Party, the YPG's political arm.

Earlier, Mr Erdogan said the military operation aims to prevent threats from "terror" groups, pointing specifically to the IS group and the PYD. He said the operation was in response to a string of attacks in Turkey, including an IS suicide bombing at a wedding party near the border which killed 54 people.

Saleh Muslim, the co-president of the PYD, warned that Turkey will pay the price, tweeting that "Turkey is in Syrian Quagmire. Will be defeated as Daesh". He used the Arabic language acronym for IS.

Jarablus is a key lynchpin in the Turkish-Kurdish rivalry. The town lies on the western bank of the Euphrates River at the Turkish border in a pocket controlled by the IS group.

The YPG and other Syrian Kurds stand on the east bank of the river, and from there they hold the entire border with Turkey all the way to Iraq. They also hold parts of the border further west, so if they ever took control of Jarablus, they would control almost the entire stretch.

Pointedly, Turkey codenamed its cross-border assault "Euphrates Shield," suggesting the aim was to keep the YPG east of the Euphrates River.

Turkish prime minister Binali Yildirim said that in Mr Biden's talks in Ankara, the two sides reached agreement that that the Syrian Kurdish forces "should never spread west of the Euphrates and not enter any kind of activity there".

Turkey has backed rebels against Syrian President Bashar Assad throughout Syria's civil war. It has carried out some air strikes and artillery barrages against militants in the past.

But Wednesday's assault was its first major ground incursion.

Some 1,500 Syrian opposition fighters were involved, said Ahmad al-Khatib, an activist embedded with the rebels.

The fighters came from the US-backed Hamza brigade, as well as rebel groups fighting government forces in Aleppo, such as the Nour el-Din el Zinki brigade, the Levant Front, and Failaq al-Sham.

Fighters from the powerful and ultraconservative Ahrar al-Sham brigade are also present, he said.

The Syrian government denounced the Turkish military incursion and called for an immediate end to what it described as a "blatant violation" of Syrian sovereignty.