It started when U.S. Special Forces confiscated some rocket launchers and a small library from ISIS fighters. But while the heavy weaponry was worrisome enough, some academics were more concerned about the hefty-looking books and the photographs of ancient coins they contained.

“It’s not a book that you look up. It’s not even one that you can find in a bookstore. It would be one that you would find in an academic library,” Sam Hardy, the author of the Conflict Antiquities blog and a specialist in illicit antiquities, tells Damaris Coulhoun for Atlas Obscura. “It suggests that they’re making educated choices.”

These photos provided some of the first material proof that the so-called Islamic State was not just destroying ancient artifacts, but specifically targeting them to sell on the black market. Academics and experts in the illegal artifact trade have long suspected that ISIS is funding itself with black market antiquities. As a result, impromptu networks of historians and archaeologists have formed both online and on the ground in the rush to identify and rescue historical artifacts before ISIS fighters can get their hands on them, writes Coulhoun. Often, experts save cultural treasures with only seconds to spare.

Meanwhile, historians at the Baghdad National Library are rushing to restore and digitize books and documents detailing Iraq’s history and culture in case ISIS fighters storm the capital. The project came into existence after 400,000 papers and 4,000 rare books were destroyed during the American invasion of Iraq in 2003, writes Vivian Salama for the Associated Press.

Every document in the collection presents its own challenge for restorers: some are damaged after years of use, some were burned during bombings or attacks and some were almost fossilized after being soaked and quickly dried in the high desert heat, Salama writes. It’s only after librarians painstakingly restore the books that they can photograph and digitize the manuscripts.

Even as historians at the National Library rush to preserve Iraq’s heritage in case of disaster, they're sending books into areas of conflict to combat ISIS’ interpretation of history and to give hope to Iraqis living under fear of the militants. “When an area is liberated, we send them books to replenish whatever was stolen or destroyed, but also, so that Iraqis in this area have access to these materials so they can always feel proud of their rich history,” Jamal Abdel-Majeed Abdulkareem, acting director of Baghdad libraries and archives, tells Salama.

These librarians, historians and archaeologists aren't alone in their fight against ISIS attempts to pillage and profit from their cultural heritage. Earlier this year, the United Nations General Assembly unanimously passed a resolution declaring ISIS' destruction of artifacts and antiquities as a war crime; at the same time, federal investigators in the United States are cracking down on relics traded on the black market. If ISIS wants to profit from raiding the Middle East's history, they are going to have to work for it.