Four metres below ground, in a tunnel full of the signs of recent Islamic State activity, the Qur’an was wedged in a gap beneath the ceiling. As Major Hama Chawri from the Kurdish peshmerga shone a torch around the room, one of his young fighters asked permission to remove the holy book.

“No, no, no!” cried the major, his voice reverberating through the tunnel. “Get out!” His alarm was prompted by a switch beside the Qur’an. “It is booby-trapped,” he said.

As they embarked this week on the battle to retake the city of Mosul and its surrounding villages from Isis, the peshmerga forces have been playing a key role alongside the Iraqi army and special forces of the US, Britain and France.

Until Monday, when the offensive began, about a dozen Isis militants had been hiding in houses in Small Badana village, about 12 miles (20km) to the east of Mosul city.

Battle for Mosul: 'This is going to take a long time – Isis won't give up' Read more

When the Guardian visited alongside Hama and his forces the following day, the only sounds coming from the abandoned village on the Nineveh plains were the song of house sparrows and the roar of aircraft overhead. The bodies of two Isis fighters had been found in the village by the peshmerga. One of them had been beheaded by a coalition airstrike.

What they and their fellow militants left behind gave an unrivalled glimpse of how the jihadis had been living and preparing defences for the Mosul offensive. The tunnel found by Hama in Small Badana had been built about 20 metres from one of the houses, with a hole in the ground leading to a dark subterranean sleeping area and makeshift kitchen.

“This is where they slept and prayed” said Hama, 46, a peshmerga since 1987, as he toured the tunnel. In the knowledge that Isis had planted improvised explosive devices in the village, he urged his men to be extra-cautious.

In the tunnel, wires stretched across a network of passageways. Using iron bars and wood to prop up the ceiling, Isis members had attempted to keep the walls from caving in. Rubbish was strewn around and the dust made breathing difficult. On the wall, a flag bore the words: “There is no god but Allah.”

Signs of a hasty retreat were clear. In one passageway, a gas stove had several pans on it, one containing fresh chickpeas soaked in water. A tray of eggs – some broken – sat next to it, while the shells of sunflower seeds on which the militants presumably snacked were scattered everywhere.

Fighting for every yard: on the ground with Kurdish troops pushing into Mosul Read more

The militants inside the tunnel appeared to have been prepared to fight to the end. One peshmerga, Hadi Mohammed, said stacked bags full of soil had been intended as a defence in case peshmerga entered the tunnel. Above ground, the rooms in the house to which the tunnel eventually led via a shaft were full of soil, almost reaching the ceiling.

For the Kurdish forces, the reclaiming of Small Badana was a lesson in the stark realities of the battle for Mosul and the huge risks it poses. During the visit, Hama said he prided himself on the fact that, although he had been fighting Isis since day one, none of the peshmerga forces under his command had died.

Two hours after the visit to the tunnel, however, one of the peshmerga reported that an IED left by Isis in the village had exploded. Two peshmerga had been killed, and another seriously wounded.