Updated

Editor's note: Brian Kilmeade is the co-author of the New York Times bestseller "Thomas Jefferson and the Tripoli Pirates: The Forgotten War That Changed American History" (Sentinel, November 3, 2015). 

President Obama was elected on a promise to end the wars in Iraq and Afghanistan and avoid new wars. But a funny thing happened on the way to peace – more terror attacks at home and the rapid rise of ISIS abroad.

No matter how much he’d rather focus on issues like global warming and gun control, the president has to rise to the challenge of this increasing Islamist threat.

America is in the crosshairs, and Obama’s legacy will depend on what he does about it in 2016.

He’s certainly not the first president to have to shift priorities on the fly. Many if not all of his predecessors entered office with a clear agenda,only to watch world events scramble their to-do lists. When that happens, great presidents adjust to new challenges -- even if it becomes necessary to break a campaign promise.

Consider our third president, Thomas Jefferson, who took office in 1801. Like Obama, Jefferson was widely considered a pacifist who preferred diplomacy over war. But when Tripoli (now Libya) declared war on us because we refused to pay extortion and ransom to the pirates off the Barbary coast, Jefferson rose to the challenge.

He started with a display of strength to intimidate our enemies, sending the U.S. Navy’s newest frigates to the region.  When that show of power wasn’t enough to get the Tripoli pirates to stop their attacks and release their hostages, Jefferson ordered bombardment from those powerful new ships.

Unfortunately, then as now, long distance bombing didn’t work. To the Islamic extremists of any generation, surviving against a Western attack is considered as good as winning. That’s why airstrikes and a few ground advisors won’t break the back of ISIS today.  In fact, ISIS just uses our bombings to recruit more terrorists.

Although Jefferson initially saw a land war as much too risky, he kept his options open. Eventually he recognized that there’s no substitute for boots on the ground. Three years into the Barbary Wars, he embraced a plan by one of America’s finest  officers, General William Eaton, to invade Tripoli over land, smash its army, and break the will of its leaders.

Eaton and a detachment of Marines took the major city of Derne in less than 3 hours. Yusef Qaramanli, the Tripoli leader, quickly surrendered.  A deal was cut, hostages were released, and America’s merchant ships could finally pass safely near the Barbary Coast.

President Obama still hasn’t learned the key lesson that Jefferson and other presidents (most recently George W. Bush) learned about the Middle East: You can’t crush an outlaw Islamist regime from the air. The more we delay putting boots on the ground against ISIS, the more the American people will lose patience – and the more power and prestige ISIS will gain for surviving our attacks.

In his final year in office, with his legacy on the line, Obama needs to realize that winning a war is more important than his pledge to end a war. He needs to empower our military and trust the experts at the Pentagon. He needs to end the irresponsible releases of terrorists from Gitmo, tighten restrictions on immigrants from countries that support terrorism, confront our enemies abroad, and do whatever it takes to keep us safe at home.

Much has changed since the early 1800s, but if President Jefferson could learn the importance of ground troops, so can our current president.