Two months after Ben Franklin helped draft the Declaration of Independence, a surprise visitor walked into his Philadelphia shop. The young man’s curly brown hair cascaded down toward his shoulders, and his English was so broken he switched to French. Thaddeus Kosciuszko, a 30-year-old Pole just off the boat from Europe via the Caribbean, introduced himself and offered to enlist as an officer in the new American nation’s army.

Franklin, curious, quizzed Kosciuszko about his education: a military academy in Warsaw, studies in Paris in civil engineering, including fort building. Franklin asked him for letters of recommendation. Kosciuszko had none.

Instead, the petitioner asked to take a placement exam in engineering and military architecture. Franklin’s bemused answer revealed the inexperience of the Continental Army. “Who would proctor such an exam,” Franklin asked, “when there is no one here who is even familiar with those subjects?”

On August 30, 1776, armed with Franklin’s recommendation and high marks on a geometry exam, Kosciuszko walked into Independence Hall (then the Pennsylvania State House) and introduced himself to the Continental Congress.

In his native Poland, Kosciuszko is known for leading the Kosciuszko Uprising of 1794, a brave insurrection against foreign rule by Russia and Prussia. But that came before the liberty-loving Pole played a key but overlooked role in the American Revolution. Though not nearly as well known as the Marquis de Lafayette, America’s most celebrated foreign ally of the era, Kosciuszko (pronounced cuz-CHOOSE-co), was in many ways his equal. Both volunteered with an idealistic belief in democracy, both had a major impact on a climactic battle in the Revolution, both returned home to play prominent roles in their own country’s history, and both enjoyed the friendship and high esteem of American Founding Fathers. Kosciuszko did something more: he held his American friends to the highest ideals of equality on the issue of slavery.

Kosciuszko was born in 1746 and grew up in a manor house, where 31 peasant families worked for his father. His early education included the democratic ideals of John Locke and ancient Greeks. Trained at Warsaw’s School of Chivalry, he enrolled in Paris’ Royal Academy of Painting and Sculpture, where his real goal was to learn civil engineering and the strategies of Sébastien Le Prestre de Vauban, Europe’s authority on forts and sieges.

Back in Poland, Kosciuszko was hired to tutor Louise Sosnowska, a wealthy lord’s daughter, and fell in love with her. They tried to elope in the fall of 1775 after Lord Sosnowski refused Kosciuszko’s request to marry her and instead arranged a marriage with a prince. According to the story Kosciuszko told various friends, Sosnowski’s guards overtook their carriage on horseback, dragged it to a stop, knocked Kosciuszko unconscious, and took Louise home by force. Thwarted, heartbroken, nearly broke – and in some accounts, fearing vengeance from Sosnowski -- Kosciuszko embarked on his long years as an expatriate. Back in Paris, he heard that the American colonists needed engineers and set sail across the Atlantic in June 1776. Detoured when his ship wrecked off Martinique, he arrived in Philadelphia two months later.

His Paris studies, though incomplete, quickly made him useful to the Americans. John Hancock appointed him a colonel in the Continental Army in October, and Franklin hired him to design and build forts on the Delaware River to help defend Philadelphia from the British navy. Kosciuszko befriended General Horatio Gates, commander of the Continental Army’s northern division, and in May 1777, Gates sent him north to New York to evaluate Fort Ticonderoga’s defenses. There, Kosciuszko and others advised that a nearby hill needed to be fortified with cannons. Superiors ignored his advice, believing it impossible to move cannons up the steep slope. That July, the British, under the command of General John Burgoyne, arrived from Canada with 8,000 men and sent six cannons up the hill, firing into the fort and forcing the Americans to evacuate. A floating log bridge designed by Kosciuszko helped them escape.

Kosciuszko’s greatest contribution to the American Revolution came later that year in the Battle of Saratoga, when the defenses along the Hudson River helped the Continental Army to victory. The British war plan called for troops from Canada and New York City to seize the Hudson Valley and divide the colonies in two. Kosciuszko identified Bemis Heights, a bluff overlooking a bend in the Hudson and near a thick wood, as the spot for Gates’ troops to build defensive barriers, parapets and trenches.

When Burgoyne’s troops arrived in September, they couldn’t penetrate Kosciuszko’s defenses. So they tried an end run through the woods, where Virginia riflemen picked them off and soldiers commanded by Benedict Arnold aggressively charged, killing and wounding 600 redcoats. Two weeks later, Burgoyne tried to attack even farther west, but the Americans surrounded and beat the British. Historians often describe Burgoyne’s surrender as the turning point of the war, since it convinced France’s King Louis XVI to negotiate to enter the war on the American side. Gates and Arnold got most of the credit, which Gates deflected to Kosciuszko. “The great tacticians of the campaign were hills and forests,” Gates wrote to Dr. Benjamin Rush of Philadelphia, “which a young Polish Engineer was skilful enough to select for my encampment.”

Kosciuszko spent the next three years improving the defense of the Hudson River, taking part in the design of Fort Clinton at West Point. Though he bickered about the fort’s design with Louis de la Radière, a French engineer also serving the Continental Army, the Americans valued his skills. George Washington often praised Kosciuszko in his correspondence and unsuccessfully asked Congress to promote him—despite spelling his name 11 different ways in his letters, including Kosiusko, Koshiosko, and Cosieski. During Benedict Arnold’s failed betrayal, he attempted to sell details about West Point’s defenses, designed by Kosciuszko, Radière, and others, to the British.

In 1780, Kosciuszko traveled south to serve as chief engineer of the Americans’ southern army in the Carolinas. There, he twice rescued American forces from British advances by directing the crossing of two rivers. His attempt to undermine the defenses of British fort in South Carolina with trench-digging failed, and in the ensuing battle, he was bayoneted in the buttocks. In 1782, the war’s waning days, Kosciuszko finally served as a field commander, spying, stealing cattle and skirmishing during the siege of Charleston. After the war, Washington honored Kosciuszko with gifts of two pistols and a sword.

After the war, Kosciuszko sailed back to Poland, hoping that the American Revolution could serve as a model for his own country to resist foreign domination and achieve democratic reforms. There, King Stanislaw II August Poniatowski was trying to rebuild the nation’s strength despite the menacing influence of Russian czarina Catherine the Great, his former lover and patron. Back home, Kosciuszko resumed his friendship with his love, Louise (now married to a prince), and joined the Polish army.

After Poland’s partition by Russia and Prussia in 1793, which overturned a more democratic 1791 constitution and chopped 115,000 square miles off Poland, Kosciuszko led an uprising against both foreign powers. Assuming the title of commander in chief of Poland, he led the rebels in a valiant seven months of battles in 1794. Catherine the Great put a price on his head and her Cossack troops defeated the rebellion that October, stabbing its leader with pikes during the battle. Kosciuszko spent two years in captivity in Russia, until Catherine’s death in 1796. A month later, her son, Paul, who disagreed with Catherine’s belligerent foreign policy, freed him. He returned to the United States in August 1797.

Kosciuszko lived in a boarding house in the capital, Philadelphia, collecting back pay for the war from Congress, and seeing old friends. By then, Americans had splintered into their first partisan conflict, between the Federalists, who admired the British system of government and feared the French Revolution, and the Republicans, who initially admired the French Revolution and feared a Federalist-led government would come to resemble the British monarchy. Kosciuszko took the side of the Francophile Republicans, resenting England’s support of Russia and seeing the Federalists as Anglophile elitists. So he avoided President John Adams, but developed a close friendship with Vice-President Thomas Jefferson.

“General Kosciuszko, I see him often,” Jefferson wrote Gates. “He is as pure a son of liberty as I have ever known, and of that liberty which is to go to all, and not to the few or rich alone.”

Kosciuszko took liberty so seriously that he was disappointed to see friends like Jefferson and Washington own slaves. During the American and Polish revolutions, Kosciuszko had employed black men as his aides-de-camp: Agrippa Hull in America, Jean Lapierre in Poland. When he returned to Europe in May 1798, hoping to organize another war to liberate Poland, Kosciuszko scribbled out a will. It left his American assets – $18,912 in back pay and 500 acres of land in Ohio, his reward for his war service -- for Jefferson to use to purchase the freedom and provide education for enslaved Africans. Jefferson, revising the draft into better legal English, also rewrote the will so that it would allow Jefferson to free some of his slaves with the bequest. The final draft, which Kosciuszko signed, called on “my friend Thomas Jefferson” to use Kosciuszko’s assets “in purchasing negroes from among his own as [well as] any others,” “giving them liberty in my name,” and “giving them an education in trades and otherwise.”

Though Kosciuszko returned to Paris, hoping to fight Russia and Prussia again, he never did. When Napoleon offered to help liberate Poland, Kosciuszko correctly sized him up, intuiting that his offer was disingenuous. (Later, many Poles in Napoleon’s service died in Haiti when they were ordered to put down Toussaint Louverture’s slave revolt.) Kosciuszko spent most of the remainder of his life in Paris, where he befriended Lafayette and celebrated American independence at Fourth of July parties with him.

One month before his 1817 death, Kosciuszko wrote Jefferson, reminding him of the terms of his will. But Jefferson, struggling with age, finances, inquiries about the estate from heirs in Europe, appeared in federal court in 1819 and asked a judge to appoint another executor of Kosciuszko’s affairs.

Kosciuszko’s will was never implemented. A year after Jefferson’s 1826 death, most of his slaves were sold at auction. A court-appointed executor squandered most of the estate, and in 1852, the U.S. Supreme Court declared the American will invalid, ruling that he had revoked it in an 1816 will. (Kosciuszko’s 1817 letter to Jefferson proves that was not his intent.)

Today, Kosciuszko is remembered with statues in Washington, Boston, Detroit and other cities, many of them the products of Polish-Americans’ efforts to assert their patriotism during the 1920s backlash against immigration. A 92-year-old foundation in his name awards $1 million annually in college scholarships and grants to Poles and Polish-Americans. There’s even a mustard named for him. Yet as Lafayette’s status as a foreign ally of the American Revolution continues to grow, Kosciuszko remains relatively obscure. Perhaps it’s because he mastered the subtle art of military fortifications; war heroes are made by bold offensives, not fort-making.

“I would say his influence is even more significant than Lafayette,” says Alex Storozynski, author of The Peasant Prince, the definitive modern biography of Kosciuszko. Without Kosciuszko’s contributions to the Battle of Saratoga, Storozynski argues, the Americans might have lost, and France might never have entered the war on the American side.

Larrie Ferriero, whose new book Brothers at Arms examines France and Spain’s role in the Revolution, says that though Kosciuszko’s role in America’s founding is less decisive than Lafayette’s, the abolitionist sentiment behind his will makes him more important as an early voice of conscience.

“He was fighting next to people who believed they were fighting for independence, but not doing it for all,” Ferriero says. “Even before Americans themselves fully came to that understanding, he saw it.”