The clue was a mention of poetry.
Lincoln had exchanged several letters with a newspaper editor about poetry and politics. So Stacy Pratt McDermott, an associate editor of The Papers of Abraham Lincoln, set about comparing the handwriting on the fragment with a letter that Andrew Johnston had written to Lincoln in 1865 and a note that Johnston had written in 1872 on an old letter from Lincoln.
The match was unmistakable.
Besides solving a mystery, the discovery sheds light on a lesser explored aspect of Lincoln's character.
"It illuminates an interesting part of Lincoln's career in that he enjoyed poetry and tried his own hand at poetry," Papers of Abraham Lincoln Director Daniel Stowell told The (Springfield) State Journal-Register.
Johnston was a native of Richmond, Va., and published the Quincy Whig in Illinois.
Lincoln had written to him on Feb. 25, 1846, to send him a piece of poetry he had requested.
Johnston's reply, sent on March 10 from Quincy, Ill., was the mystery letter. In it he thanks the future president for the poem and asks if Lincoln was its author.
In an April 18 letter, Lincoln responded that he was not, but added that he would "give all I am worth, and go in debt, to be able to write so fine a piece as I think that is."
Somehow, the March 10 letter from Johnston ended up stuffed into a wall in Lincoln's home. Some theories are that it was put there as insulation or by mischievous boys known to stuff things into cracks in the walls.
The fragment was uncovered in 1987 during a full restoration of the Lincoln Home National Historic Site.
That it survived is all the more remarkable because many of Lincoln's documents from before he became president were burned, Stowell said.
"They were cleaning house before he went to Washington in 1847 and again in 1861, and they were considered junk," Stowell told The Journal-Register. "This survived because it was put in a wall for whatever reason."