We travelled along the road to Manbij, a small town in northern Syria that has become the new frontline in the battle against the jihadist group Islamic State (IS).
Manbij sits on an intersection of roads linking the IS stronghold of Raqqa to the Turkish border and other areas under its control in Aleppo province.
The routes have become key to the group’s ability to move fighters, weapons and supplies into and out of Syria.
On 31 May, a US-backed alliance of Syrian Kurdish and Arab fighters called the Syrian Defence Forces (SDF) began an operation to take Manbij and cut the supply routes.
After some heavy fighting, Manbij was encircled and completely cut off earlier this month.
‘At the gates’
We steered clear of the main roads leading to the town as our guides warned us that IS had planted mines and roadside bombs. So we bumped along on dusty side roads.
On the way in we passed through Kobane, a town on the border with Turkey that was wrested back from IS control by Kurdish-led forces in January 2015, after a gruelling four-month battle.
Much of Kobane is now in ruins and pictures of Kurdish fighters – both women and men – who were killed in the fighting festoon the wrecked buildings.
As we get closer to the frontline near Manbij, some 55km (35 miles) to the south-east, we saw the first of the hundreds of civilians who have fled their homes since the fighting began.
They were mainly Arab villagers, camped out along the roadside and flying white flags.
When they saw an SDF vehicle, they ran forwards begging for food and water.
A young SDF fighter, also an Arab, was clearly moved.
“We are at the gates of Manbij now,” he told us.
“God willing, we will end Daesh injustice in Manbij and liberate our families and this city from them,” he added, using an Arabic acronym based on the previous name of IS.
We were taken to the site of an IS base which was recently destroyed in a US-led coalition air strike.
The bodies of dead IS militants were still lying in the field.
Kurdish fighters pointed out one who appeared to be Sudanese and another they said was a Chechen.
One of the militants was still wearing a suicide belt. In death, his fingers were frozen inches from the detonator.
Much of the SDF advance in this area was made possible by US-led coalition air support, and we could hear warplanes circling overhead.
The air strikes are being directed by foreign special forces personnel on the ground, as we saw for ourselves when we ran into a group of them close to the frontline.
They appeared to be French and American and told us to stop filming.
The Kurdish fighters told us there were also British special forces operating in the area.
Although air power has been decisive, it is not without cost.
According to the Syrian Observatory for Human Rights, a UK-based monitoring group, 49 civilians have been killed in air strikes since the offensive on Manbij began.
Civilians are often caught in the crossfire on the ground too.
In a field just behind the frontline, we came across a group of families huddled together for shelter.
Out of nowhere bullets start flying overhead and everyone had to run for cover.
We discovered that their village, which we had passed through just 10 minutes earlier, was under attack. It was a lucky escape for all of us.
At an eastern forward position, a group of Arab fighters were keeping watch on the top of a building overlooking Manbij.
Suddenly they shouted: “Daesh! Daesh!” They had caught sight of a column of people heading out of the town.
Clearly in a panic, the Arab fighters started shooting and prepared to fire a rocket-propelled grenade.
Then someone shouted that the people heading their way were civilians and not IS militants.
Down below, cars, tractors and people on foot were slowly making their way out of Manbij. Miraculously no-one had been hurt by the gunfire.
We went to talk to some of them.
“IS killed us and killed our children,” said Dabahan Wilad, an old man who was wearing traditional Arab dress.
“They made us grow long beards, and told us what to wear. The women had to be covered. May God help us!” he added.
The civilians told us there is no water or power in Manbij. Food had become very expensive and the IS militants had dug in for a fight, they said.
“It’s a disgrace,” shouted one woman, dressed in black and sitting on the back of a tractor. “There are kids and old people with us. We had to gather them all up and put them in cars to escape.”
The Syrian Observatory says 19 civilians have been killed by IS since the battle began.
There are about 8,000 SDF fighters taking part in the battle for Manbij.
Officially, the US says that the Arab fighters are leading the operation, but on the ground it is clear that it is the battle-hardened Kurdish commanders from the People’s Protection Units (YPG) who are leading the offensive.
This is a hugely sensitive issue across the border in Turkey.
Mr Erdogan has repeatedly called on the US not to support the Kurds, and last year he warned them not to cross what he called the “red line” of the Euphrates river, which runs between Manbij and Kobane.
But it is a red line the Kurdish and Arab fighters of the SDF have now gone well beyond.
The reality on the ground is that the Kurds and their Arab allies in the SDF now control more than 500km (310 miles) of the Turkish-Syrian border.
The Kurds call the area “Rojava”, or “Western Kurdistan”, and they make no secret of the fact that their goal is to capture Jarablus – the last remaining Syrian border town under IS control.
If they did this, almost the entire Turkish Syrian border would be under SDF control, with a tiny section around the western town of Azaz held by Arab rebel forces.
But that seems unlikely to happen soon.
Manbij is surrounded, but the offensive has drawn to a halt.