A surgeon at the Jomhouri hospital, one of Mosul's largest, he felt a responsibility to stay and help those most in need.
Then the Islamic State group arrived in town.
In the early days, the jihadists wielded great authority over people such as Ahmed - people critical to the city's everyday functioning.
"I had to work, if I refused, they would have shot me," he told The New Arab in his clinic in the north-east of the city. "They shot some of my colleagues".
But Ahmed's work didn't just involve treating civilians in need. "They would bring their injured fighters for treatment from all over Syria and Iraq. My hospital had the best equipment and expertise anywhere in their 'caliphate', and they knew this.
"We had already had 10 years of war and terror in Mosul when IS came - that experience made us the best."
Worried about the treatment their fighters would receive, he describes how they would sometimes post a jihadist in the operating theatre while he was operating.
|Gareth Browne reports on the phone
from Mosul for The New Arab
"I was intimidated, but I had to do my job," he said.
Ahmed and his fellow doctors were also forced to grow beards or wear the veil and were prevented from treating people of the opposite sex.
"The female nurses and doctors were forced to wear hijab; I wasn't allowed to treat women."
Despite the claims of its propaganda, IS appeared to care little for the healthcare of civilians under its control. The group would prioritise its fighters for treatment.
"I had to treat the jihadists, but of course they didn't pay me. They paid for the medicine but forced me to work without a salary," he told The New Arab. But many of the fighters Ahmed found himself treating were not from Iraq.
"They were from all over the Arab world, and from Germany, France, Russia, Tajikistan, Pakistan - everywhere but Iraq, it often seemed."
Despite the difficulties, the hospital remained functioning.
"The hospital was busy, we were performing complicated operations everyday - vasectomies, bypass operations, and pregnancies."
Those who could afford it would pay for their treatment, "but many people didn't have the money, so we treated them for free".
In more recent months, the Islamic State group's grip on power was clearly slipping. Ahmed describes an argument he had with a fighter over treating a jihadist before a civilian. "I refused, and they arrested me."
But when put in front of the judge, Ahmed was let go.
"The judge showed mercy because I was a doctor. They had so few doctors, they couldn't afford to punish me. They needed me in the hospital."
Such leniency was a far cry from their treatment of doctors in the early days of Mosul's occupation. In December 2014 it was reported that the group executed several of the hospital's top doctors without giving reasons. In recent months, under pressure on multiple fronts, the group could not afford to be so strict.
Today, with more than 80 percent of the city's east bank liberated, Ahmed is still in Mosul and still treating patients.
He now works in a Primary Health Care Centre in the north-eastern district of Al-Zahraa, alongside five other doctors and two dentists. The first civilian facility to re-open in liberated Mosul, it is now responsible for the healthcare of as many as 150,000 people.
With the support of organisations such as WAHA - a French NGO providing supplies and mentoring - and the blessing of Iraq's government, it is meeting the needs of many of those people. However, many challenges remain ahead. The pressure on clinics such as his is only likely to increase as fighting continues and more of the city is recaptured.
|The Salam hospital in Mosul
has been badly damaged [AFP]
Recent fighting in the south-east of the city has seen another of the city's largest healthcare facilities - the Salam hospital in the Al-Wadha neighbourhood - largely destroyed after IS had turned it into a military position.
It will likely be left to the smaller clinics that have survived the city's brutal bombardment to pick up the slack and treat the sick and injured of Mosul.
Fighting is audible in the distance, and many houses are reduced to rubble, but Ahmed and his fellow doctors are driving Mosul's return to normality after two haunting years under the Islamic State group.
Rising from his desk and drawing our interview to a close, Ahmed simply says: "I have to go now, my patients are waiting."
Ahmad's name has been changed for security reasons, as the doctor still has family living under the rule of the Islamic State group.
Fixing and translation services for this report provided by Makeen Mustafa.
Gareth Browne is reporting from the front lines in the battle to retake Mosul from the Islamic State group. Follow him on Twitter: @BrowneGareth