In the spring of 1837, a “long, gawky, ugly, shapeless man” walked into Joshua Speed’s dry goods store in Springfield, Illinois, requesting supplies for a bed. Speed said the cost would be US$17, which ended up being too pricey for the visitor, who asked instead for credit until Christmas. The 23-year-old Speed was nonetheless taken with this stranger; he “threw such charm around him” and betrayed a “perfect naturalness.”

The stranger was none other than a 28-year-old Abraham Lincoln, a quarter-century before he would take the oath as the 16th U.S. president.

Speed spontaneously came up with an alternative plan. He said he had a large room upstairs above the store and a double bed he was happy to share. Without a word, Lincoln picked up saddlebags that contained his life’s possessions and walked upstairs. He came back down and said, with a big smile, “Well, Speed, I’m moved.”

So began what would become one of the most important friendships in American history. It was a friendship that proved redemptive for Lincoln, helping him through two serious, suicidal bouts of depression that threatened his relationship with his future wife and his political ambitions. It is a story I tell in my new book, “Your Friend Forever, A. Lincoln: The Enduring Friendship of Abraham Lincoln and Joshua Speed.”

Love and loss

After Lincoln moved in, the two men became inseparable, sharing stories, feelings, fears, hopes and dreams.

Speed intensely idealized the impressive, articulate and very funny Lincoln, who in turn felt safe opening up to his younger friend. They shared that common bed for nearly four years, though all the evidence suggests their relationship was not sexual. It was, instead, a paradigmatic 19th-century male friendship: close, even loving, as each young man sought solace in their anxious, confused attempts at wooing women.

Lincoln especially struggled with intimacy. His first love, Ann Rutledge, had died suddenly in 1835, leaving him distraught. When he moved to Springfield, Lincoln was not in a good place. But he was still hopeful for love.

In late 1839, 21-year-old Mary Todd moved to Springfield from Lexington, Kentucky (likely to escape the stepmother she despised). Mary moved in with her older sister, Elizabeth Edwards, and her husband, Ninian, in their imposing mansion. A sprightly, appealing woman, Mary was fluent in French, could cite long passages of poetry from memory, had an excellent sense of humor and closely followed politics.

Lincoln met her at a soiree in the Edwards’ mansion – he often attended these events with Speed – and became immediately enchanted with Mary. That winter Lincoln seriously courted her. By the following summer, the two were engaged to be married, with a date set for Jan. 1, 1841.

But in a move that has baffled historians, Lincoln broke off the engagement in late December 1840 and fell into a suicidal depression. Bedridden, he was prone to hallucinations, and his friends were worried enough to hide his razor. He was, in the words of his friend, future law partner, and eventual biographer William H. Herndon, “crazy as a loon.”

What historians haven’t noted – and what I was able to discover in the course of my research – is that Speed, whose father had died in the spring of 1840, had been planning to return to Louisville, Kentucky, to straighten out the affairs of the family’s large plantation. In August and September, Speed began to post notices in the local paper, calling in his debts as he prepared to sell his store and return to Louisville.

Speed ended up not leaving until the spring of 1841. But in the fall of 1840, as his marriage to Mary Todd approached, Lincoln lived with the prospect of losing his best friend. My argument is that Lincoln became confused – even panicked – at the looming loss of Speed coupled with the fast-approaching wedding date. He spiraled and, without warning, suddenly broke off his engagement with Mary.

A brief reunion

Late in the summer of 1841, Lincoln visited Speed’s Louisville plantation. Reunited, the friends took long walks together, and Speed’s mother, Lucy, doted on Lincoln. Around this time, Speed met and quickly became engaged to Fanny Henning – at which point he also got depressed, just as Lincoln had earlier in the year.

Speed’s fears of intimacy, as he later wrote in a letter to Herndon, mirrored those of Lincoln. He even feared being separated again from his friend and ended up returning to Springfield for the rest of the fall to be with Lincoln.

But by the end of the year, Speed felt he needed to go back to Kentucky to prepare for his marriage in February. (There was no way, given the distance and his work obligations, for Lincoln to travel to Louisville for the wedding.)

It was wrenching for both men to be separated again.

During those first two months of 1842, Lincoln wrote a remarkable series of letters to Speed leading up to the marriage on Feb. 15. (Unfortunately, we don’t have Speed’s replies.) This most interior of men – “shut-mouthed,” as Herndon called him – bared his deepest feelings to his best friend.

“You know my desire to befriend you is everlasting,” Lincoln wrote in one of these letters, “that I will never cease, while I know how to do any thing.”

Lincoln’s special knowledge of Speed’s inner life pervades the very fabric of the letters. “Feeling, as I know you do,” begins the very first sentence of the first letter. In another letter, Lincoln notes, “You well know that I do not feel my own sorrows much more keenly than I do yours.” “You will feel verry badly,” he says knowingly of Speed’s fears about consummating the marriage. And later: “…it is the peculiar misfortune of both you and me, to dream dreams of Elysium [paradise in classical mythology] far exceeding all that any thing earthly can realize.”

In other words, what Speed feels, Lincoln feels. What Speed knows, Lincoln knows. What Speed does, so does Lincoln. Lincoln inserts himself into Speed’s self, which he experiences as a dimension of his own.

Testing the waters of intimacy

As Speed’s marriage approached, Lincoln projected his own confused fantasies onto his friend to vicariously test the waters of intimacy. (Lincoln and Mary Todd, at that point, weren’t in contact.)

It seems Speed barely tumbled out of his wedding bed on the morning of Feb. 16 to write his friend of his successful consummation – and how the roof didn’t fall in – which elicited a fervid response from Lincoln:

“I received yours of the 12th written the day you went down to William’s place, some days since; but delayed answering it, till I should receive the promised one, of the 16th, which came last night. I opened that latter, with intense anxiety and trepidation – so much, that although it turned out better than I expected, I have hardly yet, at the distance of ten hours, become calm.”

It’s remarkable to think that the 33-year-old Abraham Lincoln was still feeling anxious a full 10 hours after reading the news of Speed’s successful wedding. Was this an emotional turning point for Lincoln? It’s as if his fears of intimacy were suddenly allayed: If Joshua could do it, so could he. Within a few months, he resumed his courtship of Mary Todd, who had graciously waited for him. They married on Nov. 4, 1842, in the parlor of the Edwards’ home.

Some 10 days later, Lincoln ended an otherwise innocuous letter to a business partner, Samuel D. Marshall, by noting, “Nothing new here, except my marrying, which to me is a matter of profound wonder.” Lincoln would remain often sad and melancholy, but he was never again clinically depressed and suicidal. His friendship with Speed proved therapeutic, even redemptive.

Joshua Speed certainly helped guide him emotionally toward intimacy and love. As one old friend put it, Lincoln “allways thanked Josh for his Mary.”