Pity poor Gen. Lloyd Austin, top commander of U.S. forces in the Middle East.

Rarely has a U.S. general given his commander in chief better military advice, only to see it repeatedly rejected.

In 2010, Gen. Austin advised President Obama against withdrawing all U.S. forces from Iraq, recommending that the president instead leave 24,000 U.S. troops (down from 45,000) to secure the military gains made in the surge and prevent a terrorist resurgence. Had Obama listened to Austin’s counsel, the rise of the Islamic State could have been stopped.

But Obama rejected Austin’s advice and enthusiastically withdrew all U.S. all forces from the country, boasting that he was finally bringing an end to “the long war in Iraq.”

Now the “long war in Iraq” is back. And because Obama has not learned from his past mistakes, it is likely to get even longer.

Last week, Obama announced a strategy to re-defeat the terrorists in Iraq. But instead of listening to his commanders this time around, Obama once again rejected the advice of . . . you guessed it . . . Gen. Lloyd Austin.

The Post reports that, when asked for his recommendation for the best way to defeat the Islamic State in Iraq and Syria, Austin told the president that “his best military advice was to send a modest contingent of American troops, principally Special Operations forces, to advise and assist Iraqi army units in fighting the militants.” Obama was having none of it. Austin’s recommendation, The Post reports, “was cast aside in favor of options that did not involve U.S. ground forces in a front-line role.”

Indeed, in his address to the nation, Obama insisted that “American forces will not have a combat mission — we will not get dragged into another ground war in Iraq.” He declared the effort against the Islamic State “different from the wars in Iraq and Afghanistan” and modeled instead on the air campaigns he has waged against al-Qaeda affiliates such as the one in Yemen.

There’s one problem with that: The air campaign in Yemen is not working. Just this weekend al-Qaeda infiltrated forces into Yemen’s capital, Sanaa, and Yemeni officials say that al-Qaeda’s strength in Yemen is growing. And as American Enterprise Institute counterterrorism expert Katherine Zimmerman points out, al-Qaeda’s Yemeni affiliate was behind a “terror threat that closed more than 20 U.S. diplomatic posts in North Africa and the Middle East in August 2013.” If, four years from now, the Islamic State is still strong enough to force the closure of 20 U.S. embassies and consulates, then Obama’s strategy to “degrade and destroy” the group will have failed.

The Islamic State cannot be defeated from the air alone. This does not mean a re-invasion of Iraq. But as Fred and Kimberly Kagan — two key thinkers behind the successful 2007 surge in Iraq — point out in a new paper, defeating the Islamic State “will require as many as 25,000 ground troops in Iraq and Syria.” The vast majority of those troops would play a supporting role for several thousand U.S. Special Forces troops and special mission units — who would be deployed in small groups embedded with Sunni tribes (like the Sons of Iraq, who fought alongside us during the surge) as well as Kurdish pesh merga forces and Iraqi military units.

An air-only counterterrorism effort will fail because the Islamic State is not, as Obama claimed in his address, “a terrorist organization, pure and simple.” The group governs a swath of territory the size of the United Kingdom. It rules cities. It collects taxes. It controls natural resources and is bringing in $3 million a day in oil revenue. It has a conventional army — one that has won battles against other conventional armies. As Obama’s own defense secretary, Chuck Hagel, has put it, “They’re beyond just a terrorist group. They marry ideology, sophistication of strategic and tactical military prowess, they are tremendously well-funded. This is beyond anything that we’ve seen. So we must prepare for everything.”

Everything, apparently, except ground combat.

Obama seems more concerned with distinguishing what he is doing in Iraq from what the George W. Bush administration did than he is with following a war strategy that will defeat the enemy. Until a few days ago, both Obama and Secretary of State John Kerry publicly denied that we were even at war with the Islamic State — as if calling this something other than war would make it any less of a war.

Yes, we are at war with the Islamic State. And if we are to “destroy” it (as Obama promised), then the president needs to start listening to his military commanders.

If he keeps ignoring their advice, he may be in for a long, hard slog — or something far worse.

Read more from Marc Thiessen’s archive, follow him on Twitter or subscribe to his updates on Facebook.