Every two weeks Ahmed Sedeeq follows a well-worn routine. As a PhD candidate from northern Iraq with permission to study at Sheffield University, he is duty bound to register with the Home Office and quickly answer some basic questions - name, address, phone number - before carrying on with his day.
The morning of December 18 was no different. He dressed casually, went to the Government offices on Millsands and sat down with an officer to run through the normal checks - but the atmosphere suddenly changed.
"Another officer came and said 'Can you come with me to fill in some forms?' I went with him, we went into a room, he locked the door and said 'Today you are detained, your deportation is imminent from the UK'."
Because of complications with his visa, Ahmed, aged 30, was held and taken to Morton Hall, a controversial immigration removal centre in Lincolnshire where four people have died within the last year, some in suspected suicides. Campaigners are calling for the facility to be shut down and a committee of MPs has mounted an inquiry.
Ahmed spent 10 days at Morton Hall over Christmas in difficult conditions, aware he could be deported to his home city, Mosul, at any moment. The jihadist group Isis declared Mosul its capital four years ago and would likely try to kill Ahmed, he fears, because of his non-religious views.
Friends organised a petition which attracted thousands of signatures, and Ahmed was released temporarily. Sheffield University, which briefly locked his email account and other privileges, has allowed him to resume his studies, but the threat of being sent back to Iraq remains.
"I'm allowed to study as long as the Home Office gives me permission," he says. "If the Home Office decided to refuse my application, I won't be able to study. Even if I had the perfect thesis, I won't be able to submit it. That's why I'm working with the lawyer to get hold of all the paperwork I can get my hands on, so I can save this PhD. It's very tricky."
Ahmed first came to the UK in 2011 to take a masters in advanced software engineering at the university, returning to Mosul afterwards. He then gained a PhD position at Sheffield's department of computer science, and came back to Britain again in 2013 after applying for a student visa.
He tried to claim asylum in the UK in 2014, but was rejected multiple times until he eventually obtained a shortened student visa which, he says, he exceeded mistakenly.
Ahmed expresses surprise that he was detained. Talking in a city centre café, he says he was advised to carry on reporting until he had finished his course, in the hope the situation could be resolved.
"I wasn't prepared at all. I didn't see it coming, to be honest. I didn't know what to do, I was in shock. I followed exactly what they told me."
Intelligent and persuasive, he speaks quietly and gently. It's a struggle to imagine him posing any danger to national security. "I'm not a violent guy who would go off to fight or anything," he says.
After being detained, Ahmed told only his solicitor and an uncle in London about his predicament. At first he avoided telling his mother, Dura; Ahmed's father Ayad died last March and she is still struggling with losing her husband.
"She only learned about it when the petition went viral. She was very sad, she cried. But what can I do."
Ahmed holds Isis responsible for his father's death. Ayad had lung disease but was forced to leave his home when jihadist fighters commandeered it. Ahmed, who has two brothers, is convinced his health wasn't robust enough to survive being uprooted.
"He couldn't handle it," he says. "They didn't care."
At Morton Hall, Ahmed was kept on a wing with 24 rooms, where detainees shared two toilets and a bathroom.
"I was sleep deprived for the entire 10 days," he says. "In the early morning they 'checked on us' - they came and shone a flashlight in our faces, or they would just barge in with their radios on and suddenly be in your face. I had no clue what was going on, whether I was being deported."
It was a tense environment. Ahmed was held alongside people of various nationalities - some were Lithuanian and Albanian, he remembers, and many had been convicted of serious crimes. At one point he was shown how to make a lethal weapon out of a biro pen.
"I tried to stay away from any gatherings and just do my paperwork."
Internet access was limited to 50 minutes a day and meals were 'mostly curries'. When Ahmed felt ill with flu symptoms, he was given two paracetamol - if he wanted anything more, he would have to book a doctor's appointment, for which there was a long waiting list.
Staying positive was challenging but vital, he says.
"I was lucky to be surrounded by people - friends, family - who care about me. I didn't let my brain wander. Maybe people just wasted five minutes of their time signing a petition, but those five minutes meant a lot to me. I received postcards from people I'd never met in my life telling me stay strong.
"But, no matter how many people love you or care about you, you are in a different place. There are the fences, the guards, the terrible place itself, but you are completely isolated - you're completely detached from everything else. If you stay there you will be forgotten forever. It's very scary. You see men, proper men, cry - and they take their own lives. There is something fundamentally wrong if people are taking their lives."
He felt a huge sense of relief on being released. "Small things we take for granted were taken away from me. I was looking at the train station café and thinking 'I can actually buy my own food when I want'."
Ahmed is applying for a discretionary visa, in addition to making a fresh claim for asylum.
"Because we don't have anything in hand we're trying all the routes. Maybe one of them will work. My case doesn't seem that strong, for some reason. But I'm trying to save this PhD, because once I get it no-one can take it away from me."
He reports to the Government again this Friday, when he could potentially be detained further. Ahmed emphasises his belief that his life would be at risk in Iraq.
"But according to the Home Office, Iraq is safe and there's nothing wrong. It doesn't make sense. It's really difficult to move on with your life when you're living under constant threat."
In a short statement issued after Ahmed was released, the Home Office said applications were considered 'on their individual merits and in accordance with the immigration rules'.
“When someone has no leave to remain in the UK, we expect them to leave the country voluntarily. Where they do not, we will seek to enforce their departure.”
In return the university said higher education should foster 'diverse, inclusive communities of international scholarships'.
Ahmed describes himself as an open-minded atheist, who opposes radical Islamism. "I know there are some people, idiots with guns, who won't accept that. They could use any picture on social media - 'Look at him, he's holding a pint, he's with a girlfriend, he's doing this or that'."
At the time of writing the petition is nearing 70,000 signatures. Ahmed is unsure whether his case is a one-off or if other students have fallen foul of the visa rules. "I didn't meet any students there, as far as I know. I hope no-one else would face this."
But he adds: "They are following rules, regardless of whether it's fair or not. If it's legal then that's it."