When most people picture Abraham Lincoln, “inventor” is probably not the first image that comes to mind. After all, our nation’s 16th president already enjoys widespread recognition as “Honest Abe,” the “Great Emancipator,” the fallen “Captain” from Walt Whitman’s poems, the “political genius” from Doris Kearns Goodwin’s Team of Rivals, and—at least in our imagination—both a vampire hunter and an incarcerated time traveler in San Dimas. The idea that Honest Abe was an inventor to boot may sound like the stuff of steampunk fantasy, but the truth is he was a patented inventor whose lifelong appreciation for innovation spurred a technological revolution of global consequences. In hindsight, the remarkable journey of Abraham Lincoln as an inventor reads like the closest thing in U.S. history to a steampunk presidency.

It should not be too surprising that young Abe Lincoln shares more in common with Doc Brown than Van Helsing, but it has little to do with science fiction and everything to do with the U.S. Patent Office. Specifically, U.S. Patent No. 6,469: a device for “buoying vessels over shoals” according to its inventor, a 40-year-old Abraham Lincoln. Apparently, this self-taught prairie lawyer also taught himself how to buoy vessels in his early 20s, when a flatboat he worked on ran aground on a milldam in New Salem, Illinois. As retold by his friend and bodyguard Ward Hill Lamon: “the boat stuck for one night and the better part of a day … in momentary danger of breaking in two, or sinking outright.” Fortunately, the 23-year-old Lincoln was able to engineer his way out of the predicament with a “singular experiment” that everyone in New Salem apparently came to watch. Despite reading like a mix between a folk tale and a 19th-century episode of MacGyver, such is the fascinating history behind the device currently on display in the Smithsonian as the first and only patented invention attributed to a U.S. president.

Whether or not this New Salem episode marks the beginning of Lincoln’s interest in engineering, it clearly left an impression which he carried all the way to Washington, D.C., two decades later. According to historian Jason Emerson in his aptly titled Lincoln the Inventor:

Lincoln was so enamored of inventions and mechanics that during his first session as a Congressman, he took his four-year-old son, Robert, to the U.S. Patent Office to examine the invention models on public display. The visit must have been an awe-inspiring revelation to the two Lincolns.

Robert Todd Lincoln, who so shared his father’s passions that he even installed a private observatory in his Manchester mansion, cherished their visit to the U.S. Patent Office as one of his fondest memories. As for Abraham, his experience as an inventor soon blossomed into an appreciation for the patent system, which he believed “added the fuel of interest to the fire of genius.”

As a wartime president, Abraham Lincoln quickly found himself in a unique position to oversee and approve some of the latest developments for the U.S. military. Lincoln welcomed inventors to the White House, personally tested some of the new rifles being developed, and presided over a technological boom that flooded the U.S. Patent Office with thousands of new inventions. Among these were the Gatling gun, repeating rifles, and, perhaps most revolutionary of all, a remarkable, iron-hulled warship that, much like Jules Verne’s Nautilus, was “a masterpiece containing masterpieces.” That is, he helped oversee the creation of the USS Monitor—an invention containing more than 40 patentable inventions.

When Swedish-American inventor John Ericsson approached the U.S. Navy with his designs for a most unusual ironclad steamship, it was understandably met with skepticism. One sailor reported that the Monitor resembled “a cheese-box on a shingle” while crueler critics ridiculed the idea as “Ericsson’s folly.” However, with the Confederates developing an ironclad of their own, the Virginia, Lincoln overruled Ericsson’s detractors and approved the warship. “All I have to say,” Lincoln remarked after inspecting a model of the vessel, “is what the girl said when she stuck her foot into the stocking. It strikes me there’s something in it.”

Once the futuristic gunboat was completed, it met the Confederate ironclad Virginia for the most technologically consequential naval engagement of the 19th century: the battle of Hampton Roads. The previous day had been a disaster for the wooden ships of the U.S. Navy, and Lincoln’s Secretary of War Edwin M. Stanton feared the Virginia might steam up the Potomac and shell Washington. Could such a horrific scenario have befallen the Lincoln White House? Lincoln’s Naval Secretary Gideon Welles doubted it when asked directly. “I told the President [the Virginia] could not … with her heavy armor, cross the Kettle Bottom Shoals.” Apparently, the Confederate Navy had not perfected a method for buoying vessels over shoals as well as Lincoln did.

The clash between the ironclads on March 9, 1862, was as revolutionary as it was bizarre. None of the skeptics in Washington could compare to Confederate reactions to the Monitor: “An immense shingle floating in the water, with a gigantic cheese-box rising from its center; no sails, no wheels, no smokestack, no guns. What could it be?” Fighting so close that the two gunboats rammed each other repeatedly, the Monitor and the Virginia engaged in what was ultimately an indecisive standoff. However, long before the Virginia withdrew from the fighting, the winner to all the navies of the world was obvious: The ironclad had effectively trumped every wooden ship ever built. “Nine-tenths of the British Navy have been rendered comparatively useless,” observed the London Times. Sir John Hay of the British Naval Commission was more damning: “The man who goes into action in a wooden ship is a fool, and the man who sends him there is a villain.” Ericsson’s inventions and Lincoln’s instincts had completely changed the way wars would be fought.

As a revolutionary weapon made possible by a president who was able to appreciate its many marvels, it was not long before Abraham Lincoln got to inspect the USS Monitor up close. The president visited the vessel and its crew on May 7, 1862, during which time “he examined everything about the vessel with care, manifesting great interest, his remarks evidently showing that he had carefully studied what he thought to be our weak points & that he was well acquainted with all the mechanical details of our construction.” It was a radical departure from the wooden flatboat of Lincoln’s youth, but one familiar to a mind as inventive and industrious as his own.

In hindsight, it appears the Union was fortunate to have elected its only inventor-president in 1860. Although Lincoln’s support for technological innovation was not a factor for most voters, it completely revolutionized the nation he presided over. The tools of war changed in ways that would more closely resemble World War I not only through the Monitor, but due to the inventive nature of Lincoln’s generals Grant and Sherman at trench and modern warfare. The tools of industry expanded to include such useful items as the twist drill and ratchet wrench. In the Midwest, construction of the nation’s First Transcontinental Railroad began at Council Bluffs, Iowa: a site chosen by President Lincoln. The number of patents issued by the U.S. government doubled from 1861 to 1865, and by 1866, the number tripled. The stage was set for a second Industrial Revolution that Abraham Lincoln would never see, but helped invent.