One afternoon in Baghdad in the final months of 2007, a few members of a U.S. special operations task force were monitoring the feed from a Predator drone over the Iraqi capital, scanning for signs of trouble, when they spotted a large crowd gathering in the neighborhood of Sadr City.

From their large, air-conditioned tent near Baghdad International Airport, the operators sprang into action. They belonged to Task Force 17, which focused on combating the Iranian-supported Shiite militias that were killing thousands of Iraqis and hundreds of U.S. forces. Sadr City was the dense, teeming home to 3 million mostly poor Shiites. Whatever — or whoever — was bringing crowds into the streets there demanded Task Force 17’s attention.

Maj. Gen. Qassem Soleimani in 2005. (Photo: Sipa/Shutterstock)

Using an encrypted chat platform, an operator quickly texted a simple message to the drone pilot from the U.S. Air Force’s 3rd Special Operations Squadron, who was almost 7,500 miles away at Nellis Air Force Base in Las Vegas: Hold the drone above Sadr City. The personnel of Task Force 17, which operated under Joint Special Operations Command, watched as crowds filled the neighborhood’s thoroughfares. It soon became clear that an important visitor was receiving a hero’s welcome. “It was like someone was welcoming Obama to the streets of Sadr City,” said a former U.S. intelligence officer. “It was electric.”

But the drone’s feed was too grainy for the Americans to identify the VIP. In the tent, Navy personnel assigned to the National Security Agency went to work, intercepting real-time communications from Sadr City to find out more about the rally — and the man at its center. They quickly learned the mysterious visitor’s identity: Gen. Qassem Soleimani.

As leader of the Quds Force, the covert action wing of Iran’s Islamic Revolutionary Guard Corps, Soleimani was the patron of many of the Shiite militias then waging a vicious campaign against U.S. troops in Iraq. The Quds Force was providing its Shiite militia proxies with explosively formed penetrators (EFPs), a deadly type of roadside bomb that could pierce armored vehicles and would eventually claim the lives of more than 600 U.S. troops. But the EFPs weren’t the only reason that Soleimani was on Task Force 17’s radar. He was also actively supporting the Shiite militias in their bloody sectarian campaign against Iraq’s Sunni minority, and earlier that year, his operatives had helped plan a sophisticated and brazen Shiite militia attack on a joint U.S.-Iraqi military facility in Karbala that left five U.S. soldiers dead.

Story continues

Iraqi Shiites from the Badr forces militia protest against the military intervention in Yemen, in Baghdad, Iraq in 2015. (Photo: Karim Kadim/AP)

Now Soleimani was in the Predator’s sights. “We said, ‘holy s***, it’s Soleimani, pressing flesh with a bunch of people,’” said the former U.S. intelligence officer. The drone tracking Soleimani was armed with missiles, and the U.S. military could have killed the Iranian commander — and probably many others — instantly. Within the tent, “there was a discussion, of course, of whether we should do something,” said the former intelligence officer. But, even if Soleimani had been alone, the task force members present knew that the Quds Force commander was “untouchable,” said the former intelligence officer. As they watched, Soleimani parted the crowd, stepped into a building and was gone.

More than four and a half years into the U.S. occupation of Iraq — and Iran’s parallel effort to sabotage that occupation — Soleimani had also come to realize he was untouchable. He had not always believed that to be so.

In the first years of the occupation, Soleimani had moved back and forth between Iran and Iraq “constantly,” but had always taken the precautions to be expected from a seasoned intelligence officer, said John Maguire, a former senior CIA official stationed in Baghdad in the mid-2000s. Soleimani disguised his rank and identity, used only ground transportation and avoided speaking on the phone or the radio, preferring to give orders to proxies and subordinates in Iraq in person, according to Maguire. “They knew we listened to everybody,” he said.

Soleimani grew bolder. During the last years of the President George W. Bush administration, U.S. officials discovered that, with the help of Iraqi contacts, he had successfully snuck into the Green Zone — the highly fortified section of Baghdad that included the U.S. Embassy — several times. “This was a bit of an embarrassment to some in the Bush administration, and there were several officials who wanted to detain him next time this happened,” recalled a former CIA official.

However, in what became settled U.S. policy for the next dozen years, the order came down to keep American hands off the Quds Force chief. “We were asked for our assessment of what would be the fallout, and we said the Iranians would see this act as inflammatory,” said the former CIA official. “The Bush folks decided that escalating things would not be worth it and moved on.”

In their massive station in Baghdad and in smaller bases around Iraq, CIA officers quietly stewed as they watched Soleimani and his deputies gradually seize control of Iraqi institutions, taking advantage of a series of American missteps after the success of the initial U.S. invasion in March 2003. “Soleimani realized quickly that we did not have an accurate understanding of how Iraq worked,” said Maguire. “He realized that the insurgency would tie Americans in knots and allow him to kill Iraqis he had wanted to kill for years.”

Those Iraqis were mainly former members of the Saddam Hussein-era military who had fought in the Iran-Iraq War of the 1980s. Soleimani was an Iranian veteran of the same war. Iraqi Shiite politician Ahmed Chalabi, who was deputy prime minister from May 2005 to May 2006, gave Soleimani or his associates all the data they needed to organize a campaign of sectarian mass murder by their Shiite proxies, according to Maguire. “They started systematic murder every cycle of darkness,” he said. “They killed probably 30,000 Iraqis that way.”

Qassem Soleimani speaks during the 1980-88 Iran-Iraq War. (Photo: AY-Collection/SIPA/Shutterstock)

The CIA was closely monitoring all of this. The agency and the U.S. military had access to “a lot of cameras” in Sadr City that allowed them to watch live video of trainers of the Quds Force and its Lebanese proxy, Hezbollah, instructing Shiite militiamen in urban warfare, Maguire said. But when CIA officers asked Army Lt. Gen. Stanley McChrystal, head of Joint Special Operations Command (JSOC), and other senior U.S. officials, about targeting Soleimani and other Iranian intelligence figures, their requests went nowhere, according to Maguire. “I was told, ‘No, these are Iranians,’” he said. “There was no appetite for it” in the Pentagon.

A Bush administration directive shortly after the invasion meant the CIA could not take matters into its own hands, according to the former senior CIA official. “We were limited to straight intel collection,” he said. “No covert action, no influence operations.”

The CIA’s Iraqi counterparts were equally frustrated at Washington’s reluctance to kill Soleimani. “The Iraqi intel service wanted to kill him and couldn’t understand why we wouldn’t target him,” Maguire said. “They thought he was the most dangerous guy in Iraq.”

To CIA officers on the ground in Iraq, the United States was ceding the battlefield to Iran. “We turned the field over in the short term to the Iranians, then we were stunned how effectively the Iranians moved in our way,” said the former senior CIA official, who compared the Quds Force’s efforts in Iraq to his own agency’s successful 1980s program to help the Afghan mujahideen in their fight against the Soviets. “They pulled on us what we pulled on the Russians in Afghanistan. It was like a mirror program.”

It wasn’t just some in the CIA that felt their hands were tied. Task Force 17, the special operations force established to go after the Quds Force’s Shiite militias in Iraq, was likewise hamstrung. Iraqi Prime Minister Nouri al-Maliki placed tight restrictions on any targeting of the Shiite militias and particularly Quds Force operatives. The task force frequently detained Quds Force officers, but Maliki always forced the Americans to release them within hours. The few Iranians killed in Iraq by coalition forces were “in the wrong place at the wrong time,” too close to their Shiite militia counterparts during firefights or in bomb-making facilities, said the former senior CIA official. Generally, Soleimani and his lieutenants knew they were safe in Iraq.

This state of affairs persisted throughout the U.S. occupation of Iraq. McChrystal, the former JSOC commander, wrote last year of an opportunity he had in 2007 to strike a Quds Force convoy containing Soleimani as it crossed from Iran into northern Iraq. He decided to just monitor the convoy, in order “to avoid a firefight, and the contentious politics that would follow.”

U.S. officials feared targeting Soleimani or other Quds Force officers would risk escalating with Iran. “Nobody wanted to cross an official line to kill Iranians in Iraq, because that would put us at war, and we had enough with Iraq and Afghanistan,” said the former senior CIA official.

Though violence persisted, by the end of the 2000s, the Quds Force was shifting its focus from killing U.S. military personnel to long-term political influence operations. In order to transmit backchannel messages to Soleimani and the Iranian leadership, senior CIA officials in Iraq would meet “behind the scenes with senior Shia political party members, very powerful influencers in Iraqi Shia politics and say, ‘The militias must cease attacks on U.S. forces or the consequences will be severe for you and your Iranian advisers,’” recalled Douglas Wise, a former CIA Baghdad station chief.

“For the Iranians, it was an easy message to have delivered, and to accommodate, because they had already achieved their desired outcome from their position,” which was greater influence in Iraq, and a drawdown in U.S. troops, Wise said. In these meetings, the Shiite political leaders would “sit silently and listen, their chief of staff would take notes, but they knew the tide had turned.”

The proxy war didn’t die down entirely, however. Even as U.S. forces withdrew from Iraq in 2011, Soleimani kept up the attacks. “They were hitting us hard with rockets and EFPs,” said Douglas London, a retired CIA senior operations officer. “It was clearly just to bleed us. … They wanted to ensure we wouldn’t come back.”

With the United States temporarily out of the picture, “Iran increased its penetration of the Iraqi government,” said Daniel Hoffman, the former chief of the CIA’s Middle East division. But the rise of the Islamic State group — which owed much to the sectarianism of the Shiite militias and the Maliki government — brought U.S. forces back to Iraq in 2014 to prevent the fall of Baghdad to the Sunni militant group. This forced the Shiite militias and the U.S. military into an awkward partnership, with Soleimani pulling the strings of the militias.

A Zelzal ballistic missile is launched during the second day of military exercises by Iran's elite Revolutionary Guard at an undisclosed location in Iran in 2011. (Photo: EPA-EFE/Shutterstock)

By now, the Iranian general was no longer operating in the shadows. He was frequently spotted on Iraqi battlefields, taking selfies with militiamen and appearing very relaxed. The Quds Force commander was “moving around with impunity” in Iraq, Hoffman said. “Though he was in Baghdad, he might have been in Tehran.”

This made it even easier for U.S. intelligence to keep tabs on him. “We had almost daily information about his whereabouts for the better part of the last decade,” retired Army Gen. Tony Thomas wrote on LinkedIn after Soleimani’s death.

Thomas, who commanded JSOC from 2014 to 2016 and was heavily involved in the fight against the Islamic State group, said he had twice parked his airplane beside Soleimani’s during visits to Irbil, the capital of Iraqi Kurdistan. “We never had the guts or the interest to do anything about him (other than ‘sanctions’ that we didn’t enforce),” he wrote. “The reality was that he had the ability to roam and do whatever he wanted to do back then.”

There was still no interest in Washington in a strike against Soleimani or his subordinates that might trigger a wider conflict with Iran, particularly as the Obama administration negotiated with Tehran to reach a deal that would curb the Islamic Republic’s nuclear ambitions.

Although he was a two-star general, Soleimani benefited from the view in some quarters of the U.S. government that the Quds Force was an intelligence organization. “From our perspective,” said a former U.S. intelligence official, the Quds Force was seen as the equivalent of the Soviet Union’s KGB during the Cold War: a rival in the spy game, but not an organization against whose members the United States could use lethal force.

Even after U.S. officials concluded around 2013 that Iran may have been targeting undercover U.S. intelligence officers working for the Defense Department in Europe for potential assassination, there was no talk of killing Quds Force members, according to the former U.S. intelligence official. “You don’t kill the other side’s intelligence operatives,” the former official said. “It’s not in our DNA.”

When Soleimani stepped out of a Cham Wings Airbus A320 at Baghdad International Airport and climbed into a waiting SUV in the early hours of Jan. 3, he clearly was under the impression that these unwritten rules were still in effect. For so long considered the ultimate intelligence operative in the Middle East, the veteran Quds Force commander had failed to detect the shift in attitude in Washington — and in particular, in the White House — that now imperiled him. Whether he realized the extent of his error in the split seconds before a Hellfire missile incinerated his SUV is unknown.

A burning vehicle at the Baghdad International Airport following an airstrike Jan. 3 that killed Gen. Qassem Soleimani, the head of Iran's elite Quds Force, at the direction of President Trump. (Photo: Iraqi Prime Minister Press Office, via AP)

Jenna McLaughlin contributed reporting to this story.

_____

Read more from Yahoo News: