US special forces soldiers were reportedly forced to flee a town in northern Syria after Free Syrian Army fighters threatened to "slaughter" them for their "invasion", according to videos and reports posted on social media on Friday.

The US soldiers were working with Turkish forces as they advanced through al-Rai in preparation for an offensive against nearby al-Bab, which is controlled by the Islamic State group.

In the video, fighters from the FSA chant that US forces are "pigs," "crusaders" and "infidels".

"Dogs, agents of America," one man can be heard to say in Arabic, while others chant: "They are crusaders and infidels, down with America, get out you pigs," and, "They are coming to Syria to occupy it."

A voice on a megaphone can be heard to say there will be a "slaughter". The US forces were reportedly forced to leave the town after the protests.

The video was posted on Twitter hours after pictures showing men in US military uniforms in al-Rai. Another video showed US soldiers in a column of armoured vehicles and Turkish tanks speeding out of al-Rai, which is known in Turkish as Cobanbey.

US soldiers spotted in Al Rai as part of Turkey's Euphrates Shield. Turkish occupation of Syria is supported by US. pic.twitter.com/8wW8zGzta2 — Serge (@Zinvor) September 16, 2016

A voice in the video can be heard saying in Arabic: "We won't accept any Americans participating alongside us."

A senior rebel source told the Reuters news agency that "five or six" US soldiers were forced to withdraw towards the Turkish border after the protests.

A monitoring group, the Syrian Observatory for Human Rights, also reported the incident and said the US forces had left al-Rai, but were still on Syrian soil.

One US official, speaking on condition of anonymity, told Reuters that initial reports appeared to confirm the incident.

US supporting Turkish incursion

The FSA is allied with Turkish forces and ostensibly supported by the US as a "moderate" rebel group fighting against Syrian government forces.

However, Friday's confrontation highlights the complex nature of the war in Syria.

The footage is the first time US soldiers have been seen supporting Turkish forces during operation Euphrates Shield, which was launched by Turkey late last month to liberate border areas from IS control and roll back advances by Kurdish YPG militias.

The operation began with the capture from IS last month of the town of Jarabulus, and it checked the advance of the Kurdish YPG militia beyond the western bank of the Euphrates river.

The YPG, which has been trained by the US and has proved its most effective ally in its fight against IS in Syria, was ordered by both Turkey and the US to withdraw to the eastern bank.

Inserting US forces in Syria (anywhere, in support of anyone, agst anyone) guarantees trouble. If DC+Ankara not aware of that, big problem — Emile Hokayem اميل الحكيّم (@emile_hokayem) September 16, 2016

Turkish-trained brigades of the FSA fought alongside Turkish troops in Jarabulus and in later clashes with the YPG.

The direct involvement of US troops in Euphrates Shield now holds the prospect of US forces being involved in clashes with YPG fighters as Turkey advances through northern Syria - although, as the video shows, the US presence is also opposed by elements within the FSA.

Meanwhile, pictures on social media showed US flags flying in the northern Syrian town of Tal Abyad in northern Raqqa province, which is held by the YPG.

The flags were apparently raised by the YPG to protect fighters from Turkish attack. There is no official presence of US troops in the town.

Pentagon spokesman Peter Cook said: "We would call on our partner forces not to fly the American flag on their own. I would imagine that that would be communicated if indeed that's taken place in this instance."