In the first pitched battle of the civil war that shaped a newly independent Ireland, seven centuries of history burned.

On June 30, 1922, forces for and against an accommodation with Britain, Ireland’s former colonial ruler, had been fighting for three days around Dublin’s main court complex. The national Public Record Office was part of the complex, and that day it was caught in a colossal explosion. The blast and the resulting fire destroyed state secrets, church records, property deeds, tax receipts, legal documents, financial data, census returns and much more, dating back to the Middle Ages.

“It was a catastrophe,” said Peter Crooks, a medieval historian at Trinity College Dublin. “This happened just after the First World War, when all over Europe new states like Ireland were emerging from old empires. They were all trying to recover and celebrate their own histories and cultures, and now Ireland had just lost the heart of its own.”

But perhaps it was not lost forever. Over the past seven years, a team of historians, librarians and computer experts based at Trinity has located duplicates for a quarter of a million pages of these lost records in forgotten volumes housed at far-flung libraries and archives, including several in the United States. The team then creates digital copies of any documents that it finds for inclusion in the Virtual Record Treasury of Ireland, an online reconstruction of the archive. Still a work in progress, the project says its website has had more than two million visits in less than two years.

Funded by the Irish government as part of its commemorations of a century of independence, the Virtual Treasury relies in part on modern technologies — virtual imaging, online networks, artificial intelligence language models and the growing digital indexes of archives around the world — but also on dusty printed catalogs and old-school human contacts. Key to the enterprise has been a book, “A Guide to the Records Deposited in the Public Record Office of Ireland,” published three years before the fire by the office’s head archivist, Herbert Wood.