Two sneaky bookworms “cannibalized” a Pittsburgh library by swiping more than $8 million in rare tomes – including Isaac Newton’s “Principia” and George Washington’s journal – in what could be the largest book heist in history, prosecutors said.

The pricey works were pilfered from the Carnegie Library over the course of two decades by a pair of crooks who best knew the worth of the collection – archivist Gregory Priore and John Schulman, who owns Caliban Book Shop, which deals rare books.

“Greed came over me,” Priore, 61, admitted to investigators in an affidavit, according to the Washington Post. “I did it but Schulman spurred me on.”

Their folio fraud was cooked up by Priore, who had been in charge of the 30,000-item William R. Oliver Special Collections Room since 1992. He approached Schulman, 54, in the late 1990s about selling some items to help stay “afloat,” he told detectives.

“I loved that room, my whole working life,” Priore said.

Schulman’s store in the Oakland section of the city — located about a block away from Carnegie Library — billed itself as dealing “used and rare books.”

Priore would steal the historical works and drop them off at the bookshop on the way home. Schulman – who was described by his attorney as a “titan in the book community” – sold some of the literary goods on eBay.

The Allegheny District Attorney’s Office charged the men with removing 320 items and destroying 16 more. Taken were works including a 1787 first-edition book with Thomas Jefferson’s signature, Adam Smith’s “An Inquiry Into the Nature and Causes of the Wealth of Nations” and Newton’s “Philosophiae Naturalis Principia Mathematica” worth $900,000.

The one-of-a-kind items ended up all over the world. The book signed by Jefferson, “De la France et des Etats-Unis,” was sold by Caliban to Bartleby’s Books for $5,000 in 2013 – and eventually landed at Bauman Rare Books, which had it listed online for $95,000. Bauman later returned the book to detectives.

Newton’s book made its way to London book seller Peter Harrington, who bought it from Caliban in 2013 based off bogus documents that it had been properly obtained from the library. Harrington recovered the book from a private buyer and returned it.

The pair used a stamp to mark the stolen books with “withdrawn” to make them appear like they were legitimately removed from the library. Schulman told detectives he’d stopped stamping the books because it “was not the correct thing to do.”

Priore told authorities he sometimes used an X-Acto knife to carefully slice maps and illustrations from books. He placed small items in a manila folder and rolled up larger ones to sneak them out of the library.

About $1 million of the collection – including the Newton volume – has been recovered but others, like Washington’s diary, remain missing.

Prosecutors aren’t yet sure how much money the two men raked in. Priore took in about $117,000 in checks from the bookstore between 2010 and 2017 and deposited $17,000 in cash over that same period.

On Wednesday, prosecutors filed a motion to freeze two of Schulman’s bank accounts, saying the money may be needed to pay restitution, the Tribune-Review reported. But his attorneys is fighting back, arguing that he needs the cash to pay bills and support his wife, who co-owns the bookshop.

A hearing over freezing Schulman’s accounts is scheduled for Monday.

One of Priore’s accounts has already been frozen. He was placed on leave from the library in April 2017 and fired two months later – after an audit found discrepancies between a 1991 survey and what was actually in the archive room.

Last summer, a search warrant executed by detectives turned up the “withdrawn” stamp and a bunch of stolen goods at the Caliban warehouse, which art appraisers helped cops identify. Some of the items were returned to the Oliver room, which remains closed.

Schulman’s lawyer Robert G. Del Greco Jr. told the Washington Post, “The complaint sets forth serious allegations, and we are treating them as such.”

A lawyer for Priore couldn’t be reached.