In Mosul, members of the Islamic State extremist group that control the city know full well that they can expect it to be attacked soon by those who oppose them. Rumor has it the fight for Mosul, ISIS’s last large stronghold in Iraq, could begin as soon as October.

As a result, they are preparing night and day to try to defend the city they have controlled for more than two years now. Residents say that for the past two weeks, the noise from large vehicles and construction equipment hasn’t stopped.

“Trucks owned by the Mosul city council have been moving large concrete barriers to the outskirts of the city,” one local, who could not be named for security reasons, told Niqash. “Large cranes are unloading these and they are being arranged in a similar way to how the Iraqi military used to arrange them when they controlled Mosul.”

Eyewitnesses in the city confirm that at the southern end, around the neighborhoods of Mamoun, Tal al-Rumman, and Mansour, members of the extremist group have completed a three-meter-high wall. Farther ahead is the town of Qayyarah, which ISIS recently lost.

Other locals confirmed that there is a similar wall at the eastern end of the city near the neighborhoods of Somar, Dumez, and Falastin, as well as in the Kokajli and Shamali areas, where pre-fab buildings are located, in order to prevent the Iraqi Kurdish military from laying siege to that part of the city.

However, because Mosul is so large—it’s known as Iraq’s second city after Baghdad, and was home to over 2 million people—there is no way to construct a complete wall around it. That’s why they’re only building walls in areas near the main entrances to the city and in parts where they expect their enemies to attack.

Locals say all this is somewhat ironic. When ISIS first entered the city in mid-2014, it boasted about the fact that it was removing all the concrete barriers that the Iraqi army had placed around Mosul because they were no longer needed. Security would prevail under their rule, it claimed.

At the same time as the barriers are being moved, there has also been a major campaign to convince locals of ISIS’s strength and, one imagines, keep citizens on its side.

“War is coming and the survival of the caliphate will depend on the steadfastness of Mosul in confronting the infidels,” one young man, a preacher in his thirties, recently told all of those praying in the Umar ibn al-Khattab mosque in Mosul’s Nahrawan neighborhood.

“Did you hear about the battle fought by Muslims, led by the Prophet Muhammad, in [627AD]?” he asked worshippers. “Do you know how they won that battle? The people followed their leader and they did not betray him. That is why the sons of Mosul should be patient and why they should tolerate hunger, thirst, and fear. They should support the caliphate and prevent the infidels from entering the city!”

The battle the preacher was talking about was known as the Battle of al-Khandaq, or the Ditch (or Trench) in English. During this fight, Muhammad and his supporters dug a ditch around the city of Medina in Saudi Arabia and stayed inside while thousands of enemies laid siege outside. Members of ISIS have been using the same comparison online, on social media.

The walls that ISIS is building in Mosul also include a trench, measuring two meters in depth and width, on one side of the concrete barriers. This trench has already been completed in the eastern and northern parts of the city; extremists used municipal roadwork vehicles to dig the pits.

In the past ISIS had tried to dig trenches around 10 kilometers away from the city’s borders but they were stopped after repeated air strikes by planes belonging to the international anti-ISIS coalition destroyed many of their vehicles.

Just like the walls, the new trenches do not surround the whole city.

The trenches are also supposedly connected to a network of secret tunnels ISIS is building. This is being done in case the terror group is forced to fight a guerrilla war inside the city; the high population density—still an estimated 1.5 million residents—will also be used in this fighting.

In the end though, it is clear to everyone—even those living in Mosul—that in this day and age, whoever controls the airspace controls the battle. Fences and trenches won’t be able to stop armed forces from entering the city if they have air support and the best that ISIS could achieve is to extend their stay in the city by weeks, or possibly months, if they are lucky.

That’s why Mosul locals will be looking toward their southern suburbs when the time comes. ISIS fighters are expected to escape in that direction and head to safehouses in Syria, as they did in previous fighting in Fallujah and Tikrit.

This article is adapted from one originally published in Niqash, a trilingual website (Arabic, English, Kurdish) on politics, media and culture in Iraq.