On the evening of 11 August 2014, Assam Dara Ali was at home in Jalawla, southern Iraq. His wife, Teba, was putting their two young children to bed; meanwhile, Kurdish officials in Erbil were beginning to report that Jalawla had fallen to Isis. “Suddenly we heard cries of ‘Allahu Akbar’, God is greatest, from the mosque,” Assam tells me. Isis was broadcasting its takeover message from the minarets, visible from the family’s courtyard.

In the preceding months, fighters had seized large swaths of Iraq: the city of Fallujah, 40 miles west of Baghdad, the western towns of Sinjar and Makhmour, as well as Mosul, Iraq’s second largest city. The newly declared caliphate of Islamic State was expanding by the day.

Assam’s eight-year-old daughter, Hanin, had heard the same call of “Allahu Akbar” at night before, when the imam announced the end of Ramadan – a time of celebration with presents, feasting and sweets. “Daddy,” she said, running to her father in great excitement, “is it Eid?”

Assam told Teba and the children to hide under the stairs. “We stayed awake all night. We were afraid they would come into the house and kill us.” People began loading up minivans and cars, escaping along the backroads Isis soldiers wouldn’t know. Assam and his family left early the next morning, heading for Teba’s parents’ home in Baghdad. “We called neighbours and they told us which way was safe,” he says. There was only time to take their identity cards.

***

It is an early morning in late autumn, and I am in the southern Iraqi desert, driving on an empty road towards the Iranian border. There are two things you notice as you approach Jalawla, about 100 miles north-east of Baghdad. The first is people selling local produce at the side of the road: pyramids of pomegranates, caskets of plump radishes. The second is the multiple checkpoints. Since they recaptured Jalawla from Isis last November, the peshmerga – Kurdish armed fighters – has turned the town into a fortified citadel. At its entrance, there is a queue of dusty 4x4s, belching taxis, bicycles; a commotion of peshmerga and police officers; young men pushing carts, hawking fruit and cigarettes. An armed soldier taps on the window, leans in to check our documents and waves us through.

Jalawla was once a town of about 80,000, a place where people wanted to live and to visit. It had 12 mosques, good schools, a hospital with a reputation for skilled doctors and excellent maternity care. The youth club offered karate and had recently staged a highly praised performance of Oliver Twist. But mostly what drew people here was the market: a labyrinth of stalls both outside and indoors, selling everything from melons and tomatoes to fine jewellery and mobile phones. There was nothing like it for miles around.

Most of the town’s inhabitants fled during its 15-month occupation by Isis – to nearby towns, to Baghdad, or farther afield in Iraq. Around 300 families stayed behind, either because they had been told they would be “safe” under Isis rule, or because they were sympathisers.

Tipped off by local informers, Isis burned homes and businesses belonging to Shiite and Kurdish families, blew up a Shiite mosque and killed anyone with a connection to the Iraqi military. The death toll from the occupation includes 20 civilians murdered by Isis, as well as 175 peshmerga and 40 Asayesh, Kurdish security forces. Just about every home was looted – and not exclusively by Isis.

‘The children’s toys,’ Teba says, ‘they broke them all.’ Photograph: Abbie Trayler-Smith/The Guardian

Once the peshmerga regained Jalawla, after a two-day battle in November 2015, the town was stripped of explosive devices and booby traps; in February this year, it was finally declared safe for civilians. It is still a long way from returning to business as usual, the streets lined with ramshackle shops and abandoned buildings. Ninety-five per cent of the town was damaged, either as a consequence of fighting, or because buildings were occupied or destroyed by Isis. The town hall is still a pile of rubble, as is the former headquarters of Asayesh. (These security personnel now work from a makeshift office in a private house.)

After months of ghostly emptiness, people have started moving back. The population is now up to 66,000. It is possible to drink sweet black tea in glass cups from the stall in the market, as well as to buy vegetables and clothes. The health clinic, with its dentist, doctor and pharmacy, has reopened. There are the sounds of building: diggers, bulldozers, workmen.

But ordinary life has yet to resume. Twenty per cent of homes are still without water because the government has not paid the $650,000 bill for repairing the town’s water supply. Seven schools remain closed, and there is a shortage of teachers. The hospital has reduced its service, offering only A&E and dental care. Men in uniform patrol the streets, and there is a town-wide curfew on some nights.

Some of the biggest changes are, of course, not apparent to the eye. “We don’t feel safe,” Hiwa Jabari tells me, summing up the collective psyche. Jabari, a small, muscular man in his 40s who speaks excellent English, runs a pharmacy in the basement of the health clinic a few minutes’ drive from the centre of town. “Daesh [Isis] turned this into a hospital,” he explains. “They treated their wounded soldiers here and they stole everything.” He means $200,000 of drugs and medicines – stock he has since replaced thanks to a loan from a friend – as well as dispensary equipment: weighing scales, pill counters.

For many people, this was a theme of the occupation: Isis’s infatuation with their equipment. Fighters stole the air-conditioning unit from the office of the water board, as well as drilling machines. They took a generator from a school and computers from the youth centre. But Jabari points out that the militants didn’t take everything from the pharmacy: he has a souvenir, an old barcode scanner with “Belongs to Islamic State” written on it in Arabic with black marker pen. “I have no idea why they didn’t take it,” he says. “Perhaps they didn’t know what it was.”

A barcode scanner marked ‘Belongs to Islamic State’ at Hiwa Jabari’s pharmacy. Photograph: Abbie Trayler-Smith/The Guardian

Assam and his family moved back to their home in the centre of Jalawla in June, and to the bridal shop he runs nearby. When I visit, Teba is changing the nappy of four-month-old Asal, or Honey, who was conceived in exile. At 26, Teba is 30 years her husband’s junior and says she fell in love with him because “he was a man. Not like the boys my age.” They met in 2003, at the start of the Iraq war, when Teba’s family fled the bombing of Baghdad for Jalawla. They returned to Baghdad, but came back in 2006, when there was another crisis. “I said to my mother, Teba has become very beautiful,” Assam recalls, “I would like to ask for her hand.” They married 10 years ago, when she was 16.

Assam is unusual in being an Iraqi husband who has encouraged his wife to have a career. Teba has a salon, Hanin, named after their daughter, where women can have their eyebrows threaded, and their hair cut and coloured. There are posters of Britney Spears and Avril Lavigne on the walls, and a red, diaphanous curtain across the door that reads, “I love you, my darling husband.” Her husband has the shop next door, where brides come to hire elaborate wedding gowns.

Assam tells me they had never argued – until this year. The couple returned to find his shop burned and her salon trashed; Isis soldiers had tried to burn it but only succeeded in breaking the mirrors and window. There was a further, more traumatic provocation. “A friend who stayed behind called me and said, ‘Assam, your house has been taken by Isis. They are using it as a headquarters.’ Isis were sleeping and eating in our home.”

He suspects his home was chosen not because it is large and central, but because he is Shiite. Their house looks immaculate now – a shady courtyard, white walls, brightly coloured rugs and cushions – but it has taken a lot of work to get to this point. Teba opens a photo album and shows me a picture of a pile of plastic junk. “The children’s toys,” she says, “they broke them all. Hanin had a doll like a Barbie, dressed in Kurdish clothes. She played with it only once and it was wonderful; Aiman had a remote-controlled car.” There were piles of dirty pots and pans, an empty whisky bottle. Their TV, refrigerator, bed and Teba’s underwear had been taken.

Assam amid the debris left by Isis, who made his home their HQ. Photograph: Abbie Trayler-Smith/The Guardian

Meanwhile, Teba’s salon has been repaired and refurbished with the help of Oxfam. The charity has given one-off payments of $2,000 to 12 shop-holders and will help a further 150. (Assam met the criteria, but asked the charity to prioritise Teba.)

Kurdish security forces estimate that around 400 fighters occupied Jalawla, and many moved their families in. “The women came from Lebanon, Syria, even Europe and Russia,” says a spokesperson. Two Jalawla women left their husbands, stayed behind and joined Isis.

Teba says she no longer feels safe here, and wants to return to Baghdad. Her parents recently came to visit, intending to stay for a few days, but after a night under curfew, packed their bags and went back to Baghdad the next morning.

Baghdad isn’t exactly trouble-free, I say. “I know,” Teba says, “but I will be with my parents and I will feel more secure.” She also worries about her children’s education, now that the schools are so overcrowded. Every weekday morning, she gives the children eggs and bread for breakfast. She plaits Hanin’s hair and gels Aiman’s fringe – it’s the trend at school. She packs their bags, kisses them goodbye and tries not to think of the bullet-pocked wall they have to walk past to get to school. But for Assam, Jalawla is home, and he wants to stay.

***

Jalawla lies at a crossroads where Iraq, Iraqi Kurdistan and Iran meet. The town was of strategic importance to Iraq’s former ruler, Saddam Hussein, who in 1988 subjected Jalawla to a campaign of ethnic cleansing, expelling its Kurdish inhabitants and replacing them with Arabs from the south. After Hussein’s arrest in 2003, the Kurds seized their opportunity to return.

The mayor of Jalawla, Yacop Yusef, recalls the years of conflict that followed. His office is a sprawl of marble floors and heavy carved furniture, in a building that has been turned into a fortress. An armed bodyguard in aviator shades and 10 soldiers stand outside. Yusef, who became mayor in January, sits with his hands folded at an enormous boardroom desk and tells me about the tensions that played out under the leadership of Nouri al-Maliki, prime minister of Iraq from 2006 to 2014. Al-Maliki favoured his own community, the Shiites, Iraq’s long-suppressed majority, and excluded the Sunni population from any meaningful role in government. Many Sunnis felt they faced a choice between pledging allegiance to a Shiite-led Baghdad or to armed groups led by Isis.

Jalawla’s mayor, Yacop Yusef, in his office, where he has an armed bodyguard and soldiers outside. Photograph: Abbie Trayler-Smith/The Guardian

“There was a very large Sunni family in Jalawla, and half of them were working with Isis [before the occupation],” a spokesman for the security forces tells me. “They were a sleeper cell.” Isis also had support from former members of Hussein’s Ba’ath party, many of whom had converted to radical Islam in American prisons. “We have names and documents of people employed by the Ba’ath government who moved to places like Baqubah [an hour’s drive from Jalawla],” he adds. “They have assimilated themselves into the community.”

There were early warning signs in Jalawla: kidnappings; and on 8 June 2014, a suicide bomber who hit the security forces’ office. Three days later, Isis swept into Sadiyah, a 15-minute drive away, where Iraqi soldiers abandoned their positions and handed over their guns. On 14 June, the militants turned north towards Jalawla, driving pick-up trucks armed with machine guns appropriated from the Iraqi army. By 11pm on 11 August, they had taken full control.

My wife misses our wedding photos. There is an old Iraqi saying, ‘When you get upset, look at your wedding photograph'

Since its liberation last November, Jalawla has been claimed by the Kurdish government (previously, it was ruled by the Arab-dominated government in Baghdad). It even has a new name: Golahah. In the aftermath of the conflict with Isis, Iraqi Kurdistan has increased its territory by 40%.

Yusef tells me how he planned for the civilian return in March this year. “We saw what happened in Sadiyah [which was liberated in September 2015]. People got so scared, they left again. What we have done is move people back gradually, neighbourhood by neighbourhood.” The first area to be repopulated was the centre, because it was the quickest route to reviving the market. Wahda district, in south Jalawla, is still unoccupied, because the area has very limited supplies of electricity and water.

***

Maha Nabil Hussain shares a home with her parents and six brothers and sisters near the hospital. A dentist, she grew up in a town half an hour away, near the Iranian border; in 2005, Kurds forced their Sunni family out. They moved to Jalawla, but she is not happy here because “people here have closed minds. They are very traditional.”

Maha, 26, talks about the pressure she feels to wear a hijab when she’s at work. “And when I have a male patient, I have to take my brother into the clinic with me, because I don’t want to be alone.” Her worry is an attack, either physical or verbal.

The family returned from exile in Khanaqin in June, to find their home had been bombed to a pile of dust and smoke. I ask them about the most precious thing they lost. “Baby photos,” Maha’s mother says. “We used to have lots, and now we have no memories.”

The family are renting a place while their old home is rebuilt at a cost of $4,000. Their father, a retired builder, is contributing, as is Maha, who is the main breadwinner. She earns $700 a month at the hospital where she works mornings; and around $100 a day at a private health clinic. Their rent is $200 a month.

Maha Nabil Hussain: ‘We are Iraqis. My whole life is war.’ Photograph: Abbie Trayler-Smith/The Guardian

Maha’s mother thinks she should save more, and complains about her daughter’s latest purchase: a suite of ornate sofas bought for $3,500 from a shop in Khanaqin. “Why are you buying this furniture?” she asks, shaking her head in dismay. “Maybe we will be attacked again and lose everything again.”

I ask Maha if she feels safe. “We are Iraqis,” she replies. “My whole life is war.”

I meet Esmail Nordeen in the Jewish market not far from the centre of town. A relic of an older time, the market is a maze of narrow alleyways where stallholders stand motionless, waiting; purveyors of household goods with shelves of shampoo, makeup and deodorant; sellers of shoes and children’s clothing. Before the crisis, there were 400 stallholders; now there are only 30. Esmail, 42, dark and thin, is selling cigarettes from a shop called Natural Honey World; his old shop was damaged, and the honey-seller has gone out of business. “He can’t come back, because he used to buy on credit. Now no one is giving him credit, because he’s already in debt.” Esmail says he used to make $50 a day. Today, he barely clears $30 a week.

The town’s hopes are pinned on growth, but the returnees are victims of circumstance. Because Kurdistan now controls Jalawla, the Iraqi government has acknowledged only basic responsibility. The first group of returnees received a one-off incentive payment of $100-$200 per household. The Kurdish government, meanwhile, is in economic crisis. “Teachers don’t even have salaries, so can they help a damaged city?” points out Dalia Ahmed, 26, who is from Khanaqin and works for Oxfam in Jalawla. The charity is supporting the most vulnerable returnees, but the town is scrabbling to survive.

On my last day in Iraq, I go to meet Majada Abdul Rachman in Khanaqin. A former resident of Jalawla, she has been banned on the grounds of being an enemy to the peace: her son, Jamal, 34, stands accused of being an Isis informer. She insists it wasn’t him who cycled around Jalawla during the occupation pointing out to Isis which house belonged to whom. “There was a neighbour – he was a spy and it was his son who had a bicycle and was showing houses to Isis.”

Jamal tried complaining to the security forces. “They just said, ‘Complete your documents and we will review it.’ Every time he visited, they said the same thing.” He gave up and last month left for Egypt, en route to Europe, taking his wife and three of his children. His 10-year-old son, Abdullah, has stayed behind with his grandmother, because the two are so close.

Majada Abdul Rachman, her daughter, Amal Abbas Ahmed, and grandsons are forced to live in an outhouse. Photograph: Abbie Trayler-Smith/The Guardian

Majada tells me that in some ways she’s happy Jamal has gone: he was lazy and workshy. But he has left his mother and sister with a lot of problems. Every time Majada visits Jalawla, her daughter, Amal Abbas Ahmed, has to collect her from the checkpoint and confirm that she is only visiting. Until she can prove she is not an enemy to the peace, she has no option but to live with her divorced daughter in a rundown outhouse with a tattered blanket over the broken windows. I asked the security services how many former residents had been banned. They would not confirm a number, but said that 1,300 families were still waiting to return.

Back in the mayor’s office, I ask Yusef about the biggest challenge he faces. “The conflict between Shiites, Kurds and Sunnis,” he replies. “Rebuilding, electricity, water – these things can be solved, but the rivalries need time to heal.” Married with seven children aged between 18 and 25, Yusef has his own problems: his home was razed to the ground. What is the most precious thing he lost? “A walking stick,” he says. It belonged to his grandfather – a mukhtar, a religious man and a community leader. And what about his wife? “She misses our wedding photographs,” he says. “There is an old Iraqi saying, ‘Whenever you get hurt or upset, look at your wedding photograph,’” he laughs.

Meanwhile, the battle for Mosul is entering its third month. What happens the day after Isis retreats will be just as significant as the battle itself. Liberation could leave up to 1 million people homeless. What will it be like for them to return to such a damaged city? In Jalawla, the future remains uncertain. The Iraqi government has warned the Kurds that they shouldn’t get too comfortable, and will have to give up captured territory once Isis is defeated. For thousands of families, this is not the end of the story.