It was August 2007, and General David Petraeus, the top commander of U.S. forces in Iraq, was angry. In his weekly report to then-Defense Secretary Robert Gates, Petraeus wrote: “I am considering telling the President that I believe Iran is, in fact, waging war on the U.S. in Iraq, with all of the U.S. public and governmental responses that could come from that revelation. … I do believe that Iran has gone beyond merely striving for influence in Iraq and could be creating proxies to actively fight us, thinking that they can keep us distracted while they try to build WMD and set up [the Mahdi Army] to act like Lebanese Hezbollah in Iraq.”

There was no question there and then on the ground in Iraq that Iran was a very dangerous enemy. There should not be any question about that now, either. And the failure of the Obama administration to come to grips with that reality is making the task of defeating the so-called Islamic State more difficult—indeed, more likely to be impossible—every day.

There are lessons to be learned from the experience of the last decade, and of the last fortnight, but what is far from clear is whether Washington, or the American public, is likely to accept them because they imply much greater American re-engagement in the theater of battle. As a result, what we’ve seen is behavior like the proverbial ostrich burying its head in the desert sand, pretending this disaster just isn’t happening. But at a minimum we should be clear about the basic facts. In Iraq and Syria, as we square off against ISIS, the enemy of our enemy is not our friend, he is our enemy, too.

In 2007, there were 180,000 American troops in Iraq. Under Petraeus’s oversight, U.S. Joint Special Operations Command (JSOC), the elite forces responsible for hunting terrorists around the world, was divided into two task forces. Task Force 16 went after al Qaeda in Iraq, the group that eventually would spawn ISIS, while Task Force 17 was dedicated to “countering Iranian influence,” chiefly by killing or capturing members of Iraq’s Shia militias—though in some cases, it even arrested operatives of Iran’s Revolutionary Guards Corps-Quds Force (IRGC-QF) who were arming and supervising those militias’ guerrilla warfare against coalition troops.

At one point, in the summer of 2007, Petraeus concluded that the Mahdi Army, headed by the Shiite demagogue Muqtada al-Sadr, posed a greater “hindrance to long-term security in Iraq” than al Qaeda did. As recounted in The Endgame, Michael Gordon and Bernard E. Trainor’s magisterial history of the Second Iraq War, two-thirds of all American casualties in Iraq in July 2007 were incurred by Shiite militias. Weapons known as explosively formed penetrators, or EFPs, were especially effective against the U.S. forces. They were Iranian designed and constructed roadside bombs that, when detonated, became molten copper projectiles able to cut through the armor on tanks and other vehicles, maiming or killing the soldiers inside.

So it came as a surprise to many veterans of the war when Secretary of State John Kerry, asked in December what he made of the news that Iran was conducting airstrikes against ISIS in Iraq, suggested “the net effect is positive.” Similarly, Chairman of the U.S. Joint Chiefs of Staff Gen. Martin Dempsey—formerly the commander of the 1st Armored Division in Baghdad—told reporters last month, “As long as the Iraqi government remains committed to inclusivity of all the various groups inside the country, then I think Iranian influence will be positive.”

Whatever the Iraqi government says it is committed to, “inclusiveness” is not what’s happening on the ground.

Iran’s influence in Iraq since ISIS sacked Mosul last June has resulted in a wave of sectarian bloodletting and dispossession against the country’s Sunni minority population, usually at the hands of Iranian-backed Shia militia groups, but sometimes with the active collusion of the Iraq’s internal security forces. Indeed, just as news was breaking last week that ISIS’s five-month siege on the Syrian-Turkish border town Kobane finally had been broken, Reuters reported that in Iraq’s Diyala province at least 72 “unarmed Iraqis” —all Sunnis—were “taken from their homes by men in uniform; heads down and linked together, then led in small groups to a field, made to kneel, and selected to be shot one by one.”

Stories such as these out of Iraq have been frequent albeit under-publicized and reluctantly acknowledged (if at all) by Washington both before and after Operation Inherent Resolve got underway against ISIS.

For instance, 255 Sunni prisoners were executed by Shia militias and their confederates in the government’s internal security forces between June 9 and mid-July, according to Human Rights Watch. Eight of the victims were boys below the age of 18. “Sunnis are a minority in Baghdad, but they’re the majority in our morgue,” a doctor working at Iraq’s Health Ministry, told HRW at the end of July. Three forensic pathologists found that most of the victims in Baghdad were shot clean through the head, their bodies often left casually where they were killed. “The numbers have only increased since Mosul,” one doctor said.

On August 22, 2014, the Musab Bin Omair mosque in Diyala—the same province where last week’s alleged executions occurred—was raided by officers of the security forces and militants of Asaib Ahl al-Haq (the League of the Righteous), which slaughtered 34 people, according to HRW . Marie Harf, the U.S. State Department spokeswoman, said at the time: “This senseless attack underscores the urgent need for Iraqi leaders from across the political spectrum to take the necessary steps that will help unify the country against all violent extremist groups.”

Since then, however, U.S. warplanes have provided indirect air support to Asaib Ahl al-Haq and Kataib Hezbollah, a U.S.-designated terrorist entity, both of which were at the vanguard of the troops that ended ISIS’s months-long siege of Amerli, a Shia Turkomen town of about 15,000, in November 2014. These militias have also been seen and photographed or videoed operating U.S. Abrams tanks and armored vehicles intended for Iraq’s regular army, which means that there are now two terrorist organization, Sunni ISIS and Kataib Hezbollah, armed with heavy-duty American weapons of war.

The Hezbollah-ization of Iraq’s military and security forces has been overseen by the IRGC-QF, another U.S.-designated terrorist entity, which is headed by Maj. Gen. Qassem Suleimani, a man personally sanctioned by the Treasury Department for his role in propping up Bashar al Assad’s mass murderous regime in Syria.

Suleimani is the same Iranian operative Petraeus once called “evil” because of his well-documented role orchestrating attacks on U.S. servicemen. The most notorious episode happened in Karbala in 2007—in a raid that was carried out by Asaib Ahl al-Haq and resulted in the death of five G.I.s One of the founders of this militia and a main perpetrator of the attack, Qais al Khazali, was captured by coalition forces and subsequently released in a prisoner swap for a British hostage in 2009. Today, al Khazali moves freely around Iraq, dressed in battle fatigues, commanding Asaib militants.

Another one of Suleimani’s major proxies, the Badr Corps, is headed by Hadi al-Amiri, who happens to be Iraq’s former minister of transport, in which capacity he was accused by the U.S. government of helping to fly Iranian weapons and personnel into Syria. Not only was one of al-Amiri’s Badr henchmen, the group’s intelligence chief Abu Mustafa al-Sheibani, the man chiefly responsible for importing explosively formed projectiles into Iraq from Iran’s Mehran province during the occupation, but another of his subordinates, Mohammed Ghabban, is currently Iraq’s Interior Minister. This gives the Badr Corps purview over all of Iraq’s internal security forces, including its federal police—that is to say, the men in uniform who have allegedly acquiesced or connived in the Shia militias’ anti-Sunni pogroms.

Indeed, Iraq’s Interior Ministry gained notorious reputation in the last decade for being a clearinghouse for sectarian bloodletting. During the civil war in the mid-2000s, its agents, nominally aligned with U.S. troops, moonlighted as anti-Sunni death squads that functioned with the impunity of officialdom. The ministry also ran a series of torture-prisons in Baghdad, such as Site 4, where, according to a 2006 U.S. State Department cable, 1,400 detainees were held in “in squalid, cramped conditions,” with 41 of them bearing signs of physical abuse. Ministry interrogators, the cable noted, “had used threats and acts of anal rape to induce confessions and had forced juveniles to fellate them during interrogations.”

Needless to add, Badr has hardly mended its ways with the passage of time and the exit of U.S. troops from Iraq. Today, the militia has been accused of “kidnapping and summarily executing people…[and] expelling Sunnis from their homes, then looting and burning them, in some cases razing entire villages,” in the words of Human Rights Watch’s Iraq research Erin Evers, who added for good measure that the current White House strategy in Iraq is “basically paving the way for these guys to take over the country even more than they already have.”

As if taunting the Obama administration’s, Suleimani has takento popping up, Zelig-like, in photographs all over Iraq, usually from a front-line position from which ISIS has just been expelled. It is hard to overestimate the propaganda value such images now carry.

Consider this week’s blockbuster disclosure that the CIA and Israel’s Mossad collaborated in the 2008 assassination of one of Suleimani’s other high-value proxies, Hezbollah security chief Imad Mughniyeh. In close collaboration with Iran, Mughniyeh coordinated suicide attacks ranging from the 1983 U.S. Marine barracks bombings in Beirut to the blowing up of the AMIA Jewish center in Buenos Aires in 1994. Mughniyeh also was linked to the kidnapping of several Europeans and Americans in Lebanon in the 1980s, including CIA Station Chief William Buckley, believed to have died in 1985 after months of torture by Iranian and Iranian-trained interrogators.

So it is not surprising that Langley wanted Mughniyeh dead. What is suprising is that according to the Washington Post the CIA and Mossad had “a chance to kill” the Iranian master-spy Suleimani as he strolled through Damascus with Mughniyeh in 2008, but passed it up because of potential collateral damage. No doubt U.S. satellite surveillance is currently tracking Suleimani’s plain-sight movements in Iraq and Syria, too.

Last month, an Israeli attack in the Syrian sector of the Golan Heights killed Mughniyeh’s son, Jihad, who was said to have been an “intimate” protégé of Suleimani.

While segments of the U.S. intelligence establishment and punditocracy believe Iran to be a credible or necessary force for counterterrorism, the fighters associated with Suleimani’s paramilitaries profess a different agenda entirely.

In October, ISIS was driven from Jurf al-Sakher, a town about 30 miles southwest of Baghdad. The operation was said to have been planned personally by Suleimani. It featured Quds Force agents and Lebanese Hezbollah militants embedded with some 7,000 troops form the Iraqi Security Forces.

Ahmed al Zamili, the head of the 650-strong Al Qara’a Regiment, one of the militias party to that fight, told the Wall Street Journal that he actually welcomed the invasion of Iraq by ISIS because this dire event would only hasten the return of the Hidden Imam, a religious prophecy which in Shia Islam precedes the founding of a worldwide Islamic state. Al Zamili made it clear that his notion of counterinsurgency was holy war. Meanwhile, 70,000 Sunnis were driven from Jurf al-Sakher, which means “rocky bank” and has now been renamed Jurf al-Nasr (“victory bank”). The provincial council told them they would not be allowed to return for eight or ten months.

“Iran has used Iraq as a petri dish to grown new Shia jihadist groups and spread their ideology,” says Phillip Smyth, an expert on Shia militias. By Smyth’s count, there are more than 50 “highly ideological, anti-American, and rabidly sectarian” Shia militias operating in Iraq today, and recruiting more to their ranks, all with the acquiescence of the central government.

Some of Iraq’s Shia politicians have acknowledged the dismal reality that has attended Baghdad’s outsourcing of its security to “Khomeinists” — and the potential it carries for the kind of all-out sectarian bloodletting that nearly tore the country apart in the mid-2000s.

One unnamed Shia politician told the Guardian newspaper last August that groups of Shia extremists “equal in their radicalization to the Sunni Qaeda” are being created. “By arming the community and creating all these regiments of militias, I am scared that my sect and community will burn,” he said.

More recently, Iraq’s Vice President for Reconciliation, Ayad Allawi, a secular Shia who once served as the interim prime minister, told the same broadsheet that pro-government forces have been ethnically cleansing Sunnis from Baghdad. This is a starker admission of the atrocities being committed by America’s silent partner than currently is on offer by the State Department or Pentagon, and many Sunnis now suspect Washington of full collaboration with Tehran, whatever the protestations to the contrary.

When Michael Pregent, one of the authors of this essay, briefed a team of U.S. military advisors headed to Iraq recently, he warned them that they are now operating in an environment in which Iranian and Shia-militia targeting choices take priority over the recommendations of U.S. advisors and intelligence officers.

The consequence of this tacit collaboration with the Quds Force and its assets is obvious: the United States will be portrayed by ISIS propagandists as a helpmeet in the indiscriminate murder and dispossession of Sunnis.

Kerry and Dempsey would do well to pay closer attention to Iran’s air war, too. According to one Kurdish Iraqi pilot interviewed by the Guardian, Suleimani’s command center in Iraq, the Rasheed Air Base south of Baghdad, is where “the Iranians make barrel bombs” and then use Antonov planes and Huey helicoptetrs to drop them in Sunni areas — thus replicating one of the nastiest tactics of Assad’s air force in Syria.

The Anbar Awakening critical to stabilizing Iraq in the middle of the last decade was made possible by the presence of U.S. ground forces who represented to the influential Sunni tribes an impartial bulwark against the draconian rule of al Qaeda in Iraq.

Many in the Obama administration express the hope that another such awakening can be fomented, given the current political and military dynamics in Iraq. But how? ISIS has cleverly exploited the sensitivities and fears of Iraq’s Sunni tribes, offering those it hasn’t rounded up and murdered the chance to “repent” and reconcile with the so-called “Calihpate.”

ISIS: Inside the Army of Terror, a new book by the co-author of this piece, documents the tragic situation of those Sunni tribesmen who have risen up against ISIS only to be slaughtered mercilessly, sometimes with the help of their fellow tribesmen, whom ISIS had already won over. The rest of the constituents of this bellwether Sunni demographic are thus given a choice between cutting a pragmatic deal with ISIS or embracing Shia death squads as their saviors and liberators. Most have, predictably, opted for the former.

“The American approach is to leave Iraq to the Iraqis,” Sami al-Askari, a former Iraqi MP and senior advisor to former Prime Minister Nouri al-Maliki, told Reuters last November. “The Iranians don’t say leave Iraq to the Iraqis. They say leave Iraq to us.”

For the White House, that ought to define the problem, not the solution.