A rare books dealer thought he had gotten lucky in 2013 when he managed to acquire a 1787 French first edition — inscribed by Thomas Jefferson when he was ambassador to France.

“If someone else had seen it first, it would have been gone,” said the dealer, John Thomson, who owns Bartleby’s Books, an online shop.

He had no idea that his seeming good fortune was a byproduct of one of the most expansive rare book thefts in history.

The dealer at a book fair who sold it to him, John Schulman, is now accused of conspiring with a library archivist, Gregory Priore, to steal and sell rare items from the Carnegie Library of Pittsburgh.