I could smell the acrid soot a block away. The library at the University of Mosul, among the finest in the Middle East, once had a million books, historic maps, and old manuscripts. Some dated back centuries, even a millennium, Mohammed Jasim, the library’s director, told me. Among its prize acquisitions was a Quran from the ninth century, although the library also housed thousands of twenty-first-century volumes on science, philosophy, law, world history, literature, and the arts. Six hundred thousand books were in Arabic; many of the rest were in English. During the thirty-two months that the Islamic State ruled the city, the university campus, on tree-lined grounds near the Tigris River, was gradually closed down and then torched. Quite intentionally, the library was hardest hit. ISIS sought to kill the ideas within its walls—or at least the access to them.

On a rainy day this spring, I walked the muddy and eerily deserted university grounds, in eastern Mosul. I turned a corner and saw the library, a block-long building, charred black and its shell strewn, inside and out, with splintered glass, burnt beams, heat-warped furniture, toppled shelves, and mounds of ashes. In December, as the Iraqi Army pushed into Mosul, ISIS fighters had set the library alight. The books had served as kindling.

“My life’s work,” Jasim said, when we spoke by telephone two weeks ago. “I’d rather my house be destroyed, not the library. All my memories, all the people we helped there—we helped develop the city and the country. Whenever I speak about the library, it’s as if I’m putting my hand on an open wound.”

Despite enduring dictators, an extremist rampage that reconfigured Iraq’s borders, and three long wars over the course of four decades, Iraqis are known for their intellectual curiosity and literacy. There’s a famous saying in the Middle East: “Books are written in Egypt, printed in Lebanon, and read in Iraq.” For centuries, private home libraries were considered a sign of class. After the University of Mosul was founded, in 1967, sixty of the city’s largest private libraries donated their historic collections to the new campus library, Jasim told me. Those volumes are all gone now, too.

ISIS had already destroyed Mosul’s central library, the other major resource center in Iraq’s second-largest city, which was once a cosmopolitan melting pot of disparate religions and ethnicities. Irina Bokova, the director-general of UNESCO, called it “the systematic destruction of heritage and the persecution of minorities that seeks to wipe out the cultural diversity that is the soul of the Iraqi people. Burning books is an attack on the culture, knowledge and memory.”

The future of the university, especially its library, is a microcosm of the challenge facing Iraq after the ouster of ISIS fighters and the end of their pseudo-caliphate. It’s one thing to erect four walls to rebuild shattered homes; it’s another to re-create institutions.

As I walked the university grounds that day, the only sounds were from bombs, mortars, artillery, and automatic rifles across the Tigris, in western Mosul. Every building on campus was damaged. The main boulevard had been bombed by the U.S.-led coalition, one of many streets in Mosul hit preëmptively to slow the potential advance of ISIS suicide bombers from university grounds. One of the bombs had left a huge crater spanning the street. The only other people on campus were members of a small demining team from the Iraqi Army. One of its heavy armor-plated vehicles had gotten stuck in the mud trying to get around the crater.

The previous day, the demining team had dismantled thirteen booby-trapped bombs left by ISIS in classrooms, hallways, offices, even wastebaskets, Captain Ahmed Hamid Jebur told me. The workers had defused six more bombs the morning before we met. The team showed me the translucent trip wires—as thin as dental floss—connected to shells from a fifty-seven-millimetre anti-aircraft gun. The bomb has been crudely improvised from disparate parts, hence the name improvised explosive devices, or I.E.D.s, now the hallmark of extremist movements across the Middle East and South Asia. Jebur showed me videos on his cell phone of his team finding, then dismembering, the bombs. This footage was the only official record. He had lost several men clearing out I.E.D.s left behind by ISIS.

Jebur and his men volunteered to take me through several buildings that they had cleared, including the science department. ISIS reportedly used the labs there to work on basic versions of chemical weapons. The Iraqi Army had just removed the last I.E.D.s in the department—or so the team believed. With no electricity on campus, the only light inside any of the buildings was from our cell phones.

The demining team was bolder than I in its movements. As we maneuvered through heaps of debris, I worried about trip wires. “Come,” Jebur encouraged me.

The hulking library was the most haunting of the buildings. Jebur and two of his men, rifles slung over their shoulders, led me through it. The only sign of what it had been was an occasional scrap of paper from a book, its edges burned brown, on the ground. Chronicles and records of Mosul’s rich past—which dates to antiquity—perished along with the books. Jebur kept shaking his head as he surveyed the scorched facility.

The University of Mosul, which enrolled forty thousand students in peacetime, wants to reopen for the new school year in October, the university's president, Obay al-Dewachi, told me by phone. After the ISIS blitz into Iraq from Syria, in mid-2014, many faculty members and students fled Mosul, mainly to northern Kurdistan. In exile, staff organized makeshift classes in motels, in Kirkuk and Dohuk. The obstacles of returning to Mosul are daunting: tens of thousands of families have to decide whether to go back to a city that is physically ravaged, politically dysfunctional, and lacking a working economy or electricity. At the university, parts of the campus will require a massive cleanup. “Windows and doors are broken even in buildings not destroyed,” Dewachi told me. Other departments will have to be rebuilt from scratch. Security will be an issue, too. The growing fear in Mosul is that ISIS will sneak suicide bombers back into the city, as it has done to other parts of Iraq under the control of the government in Baghdad.

Then, there’s the problem of books. On May 25th, students organized a book drive outside the gutted library, even as battles between the Iraqi Army and ISIS militants echoed from across the river. Four young musicians performed in front of the library steps. Three students pinned their photographs of people and places and life in Mosul on a long clothesline and recounted the stories behind them. Four painters displayed their work, propped on easels. The event was the brainchild of Mosul Eye, a pseudonymous historian and blogger who chronicled life under ISIS rule until he fled Iraq, last year. (He spoke on the condition of anonymity, since he still has family in Mosul.) Before the ISIS invasion, in 2014, he spent long hours in the library each week doing research, he told me. From abroad, he’s now trying to coördinate a cultural rebirth in Mosul, beginning with its university.