Mosul, Iraq - In June 2014, fighters with the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) entered Safwan Najah's laboratory at Mosul University and demanded that the biochemist hand over her keys.

The campus, like the rest of Mosul, had come under the control of ISIL fighters, and the group had new plans for its facilities.

More than two-and-a-half years on, Iraqi Security Forces finally drove the last ISIL fighters from the campus in eastern Mosul last week, as part of an ongoing campaign to retake the city. As the fighting continued last Tuesday, Najah, her husband and their five children fled their home in the nearby Shorta district, passing through the campus on their way to safety.

"They destroyed it," Najah said, looking around at torched buildings, cratered roads and parched grounds. "They took the keys from me and I don't know what happened after that."

The university now bears the scars of its use as an ISIL facility, as well as of the fight to retake it. Faculty and students are already planning to rebuild and to catch up on lost time, determined that the period of occupation should not destroy the university's legacy.

The Iraqi special forces who retook the campus said that parts were repurposed as weapons production facilities.

"There are chemical weapons there," Brigadier-General Sami al-Aradi told Al Jazeera. "We've cordoned off the laboratories until we can find out exactly what ISIS were doing."

Other buildings believed to have been used as weapons workshops or ISIL barracks were destroyed by coalition air strikes. Most of the remaining facilities appeared to have been torched by ISIL fighters themselves.

In many ways, Mosul University - one of the largest and most respected educational and research institutions in the Middle East - represented the ideological antithesis of what ISIL stood for.

"ISIS cancelled political science, law, arts, business administration classes," said Ahmed al-Rashidi, the university's student union president.

To cement their disdain for higher learning, ISIL fighters then set many of the buildings alight - including the university library, said to have had one of the largest collections in the Middle East. Medicine, dentistry, nursing and pharmacy were the only courses that ISIL permitted to continue being taught.

Like many students, 23-year-old Rashidi, a final-year veterinary medicine student, chose to flee Mosul rather than miss out on an education. With so many students living in exile in nearby Kirkuk and in Iraq's Kurdish region, they were soon agitating for the government to provide distance learning. This culminated in August 2015, when students successfully protested in Kirkuk, demanding that their courses be taught in exile: "We continued studying in Kirkuk and 14,000 students were able to complete their studies."

Now, Rashidi is in the capital of the autonomous Kurdish region, Erbil, lobbying for the university to offer expedited courses and rescheduled exams to the 40 percent of students who remained in Mosul, in an effort to allow them to catch up for lost time. "This is the main problem for us now," he said.

READ MORE: Getting Iraq's war victims back on their feet

Bilal Mohand, 23, was among the students unable to leave Mosul. "When ISIS arrived, many students didn't have the money to leave," he told Al Jazeera in a telephone interview.

Others made the decision to continue their studies at the school of medicine. With the syllabus initially unchanged, he thought that things would remain the same; but soon after ISIL had hung its black flag, members of the "hisba" religious police started enforcing rigid uniform codes.

Bilal continued his studies for a year, but eventually left when ISIL replaced the director of the school of medicine with one of the group's supporters. Life in Mosul became untenable, he said, but it took him two attempts before he could escape by bribing ISIL fighters at a checkpoint.

Now living in Erbil, he hopes to return to Mosul to continue his studies.

Like many faculty members, professor and school chancellor Abay Saied al-Dewachi fled Mosul after the ISIL takeover and watched in horror from Kirkuk as the group attempted to destroy his institution.

"It was as if they were going to omit Mosul University from the history of higher education," he told Al Jazeera in a telephone interview. It was, therefore, fitting that the university - founded in 1967 - could celebrate its 50th anniversary by being liberated, he said.

Dewachi attributed the university's academic reputation not to its bricks-and-mortar facilities, but to the fact that it followed the British system of education and did not allow poorly performing students to bribe their way to passing grades.

Noting that the university had rebounded after being damaged twice before during the 1991 Gulf War and the 2003 US invasion of Iraq, Dewachi expressed optimism that the university would again be restored to its earlier status as an example of higher learning in the Middle East. "We are ready to do everything to rebuild our university," he said.

Back in Mosul, Najah did not stop to look around as she walked through the university campus, even though it was her first time back since 2014 at an institution where she had worked for 11 years.

Soldiers warned that the buildings might be booby-trapped, and while the elevated position of the university offered a commanding view of the ongoing fighting, it also made potential sniper targets of anyone who lingered.

"I will return to work here," Najah vowed, with a final backwards glance. "Life must continue."