It was July 25, 2004. Violence was escalating in Iraq, the Taliban were reasserting themselves in Afghanistan, and Joint Special Operations Command—the U.S. military’s cadre of elite special operations forces—was already deploying operators to the Horn of Africa and Yemen. But for the first day of the three-day JSOC commanders’ conference at Fort Bragg, the country under discussion was Iran.

In the days after September 11, JSOC was running at least two undercover agents into Iran. But the command wanted to know more—much more—about the would-be regional superpower it seemed to confront at every turn.

Today, the U.S. and Iranian governments are in a period of political détente, with the nuclear deal signed in Vienna. Tehran and Washington’s militaries are even cooperating—if at arm’s length—in the fight against ISIS.

But this is hardly a friendship, especially not with Iran’s long, long history of supporting terror—and JSOC’s history of trying to kill those Iranian-backed terrorists.

After 9/11, about 10 leading al Qaeda figures, including bin Laden’s son Saad, had fled Afghanistan for Iran. The Pentagon tasked JSOC to plan a mission to seize the al Qaeda personnel. Planners considered infiltrating SEAL Team 6 operators via submersible or helicopter. “The SEALs really definitely wanted to do it ... because it would have proven a few of their new technologies,” said a Joint Staff source. But attempts to plan a raid foundered on a lack of intelligence. JSOC simply did not know the al Qaeda personnel’s exact locations. The command conducted several rehearsals in Texas before Chairman of the Joint Chiefs General Richard Myers canceled the mission on the grounds that the risks—both tactical and political-military—exceeded the potential gains.

The U.S. invasion and subsequent occupation of Iraq gave JSOC more opportunities to penetrate Iran. After the invasion, the U.S. Army’s Delta Force and a secret human and signals intelligence unit nicknamed Task Force Orange did quiet work along the Iranian border, particularly in Kurdistan, where Delta quickly made connections with the Asayish—the Kurdish intelligence organization that had one or more spies reporting on the Iranian nuclear program. Delta enlisted the help of other Iraqis as well in its twin campaigns against al Qaeda in Iraq and Iran’s covert operatives, but “the guys with the greatest access and placement were the Kurds,” said a task force officer. “They delivered some fucking huge targets to us.” Delta wasn’t the only unit working with the Asayish. “There’s a long history between Orange and the Kurds going back to at least the early 1990s,” said a special mission unit officer.

JSOC personnel also worked with the Mujahideen-e-Khalq (MEK), a militant Iranian exile group that had based itself in Iraq after falling afoul of the ayatollahs’ regime in Tehran. The State Department had placed the MEK on its list of designated terrorist organizations, but that didn’t stop JSOC from taking an attitude of “the enemy of my enemy is my friend” toward the group. “They were a group of folks that could transit the border, and they were willing to help us out on what we wanted to do with Iran,” said a special operations officer.

But JSOC was keen to get more of its own people into Iran.

In 2003, tantalizing information reached the command that caused JSOC chief Maj. Gen. Stan McChrystal to direct the advance force operations cell to examine ways to infiltrate Iran. JSOC heard that Iran had moved Saad bin Laden and the other al Qaeda exiles from Afghanistan to a comfortable “country club”-like facility in downtown Tehran, according to a JSOC staff officer. The JSOC commander wanted the AFO cell to determine the feasibility of entering Iran, going to the prison in Tehran, and confirming that Saad was being held there. Inside JSOC, it was considered a very high-risk mission. But the AFO personnel were surprised to discover that someone could drive to the Iranian border, show an American passport, get a ten-day tourist visa, and enter the country immediately, whereas if the same person applied for a visa through an Iranian embassy or consulate, “then they’re going to pull your Social Security number, then they’re going to do the background diligence on you,” said a source familiar with the operation. Nonetheless, the AFO cell’s assessment was that it would take at least a year to be able to work up a “legend” (a spy’s claimed biography—his cover story) and a cover that would allow a special mission unit operator to enter Iran, get to the prison, gather information, and then leave without attracting suspicion.

McChrystal wasn’t happy. “I need it sooner than that,” he said that fall. When the AFO cell came back to him a month later with the same assessment, this time backed up by the new Orange commander, Colonel Konrad “KT” Trautman, McChrystal told Trautman he wanted Orange to take a closer look at how the mission might be conducted sooner.

But while Orange planned, the growing concern over Iran’s suspected nuclear program changed the mission from reconnoitering the prison to determining whether fissile material was being produced at certain sites. By spring 2004, Orange had selected a two-person male-female team for a proof-of-concept mission and figured out an effective cover for them. McChrystal approved the plan and sent it up the chain of command. But because it involved undercover operatives on a clandestine mission into a country with which the United States was not at war, Orange also needed the CIA’s approval, which proved harder to obtain. “We had a really difficult time getting it approved by the Agency,” said an officer. “They had their own equities to protect.” After the CIA agreed, President Bush gave his okay. The mission finally launched in fall 2004, a delay that appeared to prove the AFO cell correct in its assessment of how long it would take to prepare for such an operation. The operatives’ cover was strong enough to get visas through an Iranian consulate, so they dispensed with the idea of driving up to the border and instead flew commercial into a major Iranian city and checked into a hotel. They spent several days taking taxis around and outside the city, and determined that it would not be difficult to get close enough to the suspected nuclear sites to take a soil sample. But on this occasion, they chose not to. “That wasn’t the mission,” said the source familiar with the operation. “[The mission] at the time was just to get in and get out.”

That kind of caution was typical. The United States’ post-9/11 occupation of Afghanistan gave U.S. forces access to that country’s border with Iran. But for several years, risk aversion restricted almost any effort to take advantage of that for human intelligence purposes. It wasn’t until 2007 that JSOC started a program to penetrate Iran using trained Afghan surrogates. “It was kind of one of those things . . . that the rest of the world assumes that we’re [already] doing,” said a special operations officer. Nonetheless, the Defense Department considered the program so hush-hush that the officer recalled being ushered into “the room within the room within the room” in the Pentagon to receive a briefing on the topic. The officer’s reaction to the briefing was, “You mean we’re not doing this already?”

***

Striding out of the Baghdad International Airport arrivals terminal, dressed in a suit and fresh off the flight from Tehran, the fifty-something Iranian was looking for a taxi on a warm April night in 2009. As he scanned the street, a small plane high above the airport filmed him, transmitting video in real time to a strike force of Rangers and SEALs, who had parked four Stryker wheeled armored vehicles and two nondescript Toyota HiLux trucks in a covered area used by taxis waiting to pick up fares at the airport. The Iranian dialed a number on his cell phone. Using data from that call, the Rangers confirmed his identity within moments. Loading into the HiLuxes, about half a dozen Rangers moved a short distance forward before dismounting quickly and encircling the Iranian.

Surrounded by heavily armed soldiers from one of the world’s premier light infantry regiments, the Iranian did not appear in the least flustered. He just laughed, before coming up with perhaps the worst insult he could think of. “Are you guys Jews?” he asked (probably equating “Jews” with “Israelis”). “What?” the Ranger platoon leader asked. The Iranian said he asked “because surely the Americans aren’t stupid enough to detain me.”

His self-confidence was no false bravado. The situation typified a Gordian knot of a problem the United States faced in Iraq. The Rangers’ target was a senior figure in Iran’s powerful covert operations organization: the Islamic Revolutionary Guard Corps’ Quds Force. Carrying a diplomatic passport, he had come to Iraq as part of Iran’s campaign to destabilize its neighbor by distributing training, bombs, and money among not only Shi’ite militias—the natural allies of the Shi’ite theocracy that governed Iran—but even Sunni insurgent groups. However, the Quds Force’s vast web of alliances throughout Iraq’s Shi’ite political structure meant any American moves against its operatives were matters of extraordinary sensitivity. The Quds Force operative had laughed at his would-be captors, said a U.S. officer, “because he knew he was protected.”

Established during the Iran-Iraq War of the 1980s, the Quds Force combined the roles of intelligence collection and covert action for Iran, taking the lead in the Islamic Republic’s special operations and proxy wars in the Middle East and beyond. It was the power behind Lebanon’s Hezbollah organization and now sought to weaken Iraq and kill U.S. troops in the country. It was the Quds Force commander, Qassem Suleimani, rather than the foreign minister, who set Iran’s policy in Iraq.

Suleimani wielded power in Iraq via a complex and shifting web of proxy forces. These included: the Badr Organization, which began as the Iranian-funded and -led armed wing of the Supreme Council of the Islamic Revolution in Iraq, or SCIRI; firebrand cleric Moqtada al Sadr’s militia, Jaish al-Mahdi, and in particular, its even more extremist and violent offshoots referred to by the Coalition as “special groups”; Asaib Ahl al Haq (the League of the Righteous); the al-Gharawai Network in southeastern Iraq’s Maysan province; and Khatab Hezbollah. Suleimani found the Badr Organization particularly useful. The Quds Force used the Badr Organization for intelligence collection as well as militia activities, with its proxies in the organization passing information directly to Quds Force handlers.

Iran’s strategic goal of destabilizing Iraq created some strange bedfellows, with the Quds Force—the covert arm of Iran’s Shi’ite theocracy— even cozying up to Sunni insurgent networks. “It was 100 percent ‘Are you willing to kill Americans and are you willing to coordinate attacks?’” said an officer who studied the Quds Force’s approach closely. “‘If the answer is “yes,” here’s arms, here’s money.’”

The officer compared this approach to that employed by the CIA in the 1980s, when the Agency armed and funded the Afghan mujahideen in their war against Soviet occupiers and their Afghan communist allies.

In early 2005, the Quds Force introduced a new weapon onto the Iraqi battlefield: the explosively formed projectile (EFP), a sort of roadside bomb that sent a jet of molten copper slicing through Coalition armored vehicles. EFP use increased 150 percent in 2006, inflicting 30 percent of U.S. casualties from October through December. Not long afterwards, some U.S. intelligence estimates held that as many as 150 Iranian operatives were in Iraq. For several years large sections of the U.S. government had seemed in denial about the extent of the Quds Force’s activities, but after years of reluctance to confront the Iranians, the U.S. chain of command could no longer ignore the toll in blood extracted by the Quds Force.

JSOC began targeting Iranian proxies in Iraq in October 2006. The new missions were collectively described within the command as “countering malign Iranian influence.” Between November 2006 and January 2007, McChrystal’s task force conducted two such missions. In the first, on December 21, operators descended on Objective Clarke, the Baghdad compound of SCIRI leader Abdul Aziz Hakim. Inside the compound they found and detained Iranian Brigadier General Mohsen Chirazi, who directed all Quds Force operations in Iraq, and the colonel who served as the Quds Force’s chief of operations. After strong protests from Iranian and Iraqi political leaders, JSOC released the pair nine days later.

In the second mission, the task force launched a combined air and ground assault on Objective Twins, an Iranian diplomatic compound in the northern Iraqi city of Irbil, in the early hours of January 11. The Delta operators were hoping to snare Mohammed Jafari, the deputy head of Iran’s Security Council who was playing a key role in the Iraq campaign, and General Minjahar Frouzanda, the Revolutionary Guard’s intelligence chief. Neither target was present in the walled compound, however. Instead, the operators detained five lower-ranking Revolutionary Guard personnel who became known as “the Irbil five.”

The Quds Force struck back January 20, with a carefully planned attack on the Karbala Provisional Joint Coordination Center, a compound manned by U.S. and Iraqi troops in central Iraq. The League of the Righteous, one of the Iranians’ most dangerous proxy forces, carried out the attack, driving eight black SUVs and wearing U.S. uniforms to gain access to the compound. They killed one U.S. soldier on the spot and kidnapped four, only to execute them shortly thereafter while making their escape.

By the time General David Petraeus replaced George Casey as commander of Multi-National Force-Iraq on February 10, 2007, what had been a one-sided campaign on the part of the Quds Force and its Iraqi agents had become a war. “It was clear … that these guys were active proxies for Iran—they were doing Iran’s bidding in Iraq,” said an Army civilian who spent time there. “When Dave Petraeus was commander in Iraq, he was determined to stop that.” He turned to JSOC.

The new task force was named Task Force 17. Its mission statement was simple: “TF 17 defeats IRGC-QF [Islamic Revolutionary Guard Corps-Quds Force], their proxies and surrogate networks in Iraq IOT [in order to] disrupt malign Iranian influence.” In layman’s terms, Task Force 17’s mandate was to go after “anything that Iran is doing to aid in the destabilization of Iraq,” said a Task Force 17 officer. The task force was to work along three “lines of operation”: disrupting the Quds Force’s networks in Iraq “through kinetic targeting” (i.e., via kill-or-capture missions); using captured intelligence materials to enable nonkinetic pressure to be brought to bear on key Shi’ite leaders; and isolating the Quds Force from its Iraqi proxies. Task Force 17’s campaign against the Quds Force was called Operation Canine.

But Task Force 17 faced political obstacles that other JSOC units in Iraq did not. While Iraq’s Shi’ite political leadership was only too happy to have McChrystal’s ruthless machine grind away at the Sunni insurgency, there was enormous sensitivity over the targeting of Shi’ite groups, even those who were clearly murdering other Iraqis. The political connections of some of the most savage Shi’ite militia leaders meant there was “an unofficial list of Shiites whom we could not knowingly target,” McChrystal wrote. This dynamic would act as a brake on Task Force 17 throughout its existence.

Take a mission launched on October 20, 2007. That night Rangers from B Company, 2nd Ranger Battalion, launched a ground raid into Sadr City to get a Shi’ite special groups leader. The Rangers missed their target, and then found themselves virtually surrounded by Shi’ite militants in the dense urban jungle. With the support of helicopter gunships, the task force fought its way out block by block, killing an estimated forty-nine militiamen without suffering a single fatality. “It was like the Mogadishu Mile [in] and then the Mogadishu Mile out,” a Ranger officer said, referring to a particularly violent battle that JSOC had fought in Somalia. “There was a substantial amount of collateral damage.”

The political backlash from conducting a large, violent operation in the heart of Shi’ite Baghdad was immediate. U.S. forces could virtually level entire neighborhoods in a Sunni city like Fallujah without upsetting Iraq’s Shi’ite leaders, but kinetic action, even on a much smaller scale, in Sadr City crossed a line. Petraeus was worried. Maliki, a Shi’ite whose government had a distinctly anti-Sunni bent, was enraged. His government accused U.S. forces of killing fifteen civilians in the raid. From January 2008 on, Task Force 17 was no longer authorized to enter Sadr City.

To some observers, the Sadr City operation exemplified Task Force 17’s overreliance on firepower at the expense of precision. “Whenever they did anything, they tended to shoot the shit out of everything,” a retired Special Forces officer said. “Either they shot everything up, killed the wrong person, captured the wrong person who was related to someone, or didn’t coordinate with the locals.”

As a result there were standing restrictions on Task Force 17 operations in the provinces that had been turned over to Iraqi control (there were nine by the end of 2007), as well as the province of Qadisiyah and the cities Hindiyah, Najaf, and Karbala, in addition to Sadr City—“all their safe havens,” as the Ranger officer put it. Before striking a target Task Force 17 needed to get it approved on the day of the raid all the way up the chain of command to Petraeus.

“TF 17 was very political,” said a Ranger officer who served in it. “There were a lot of times when we detained a senior-level Quds operative who had a diplomatic passport. ... We’d get called and Maliki would shut down JSOC for a day, and say ‘Until he’s in my compound, all JSOC operations are closed.’ Not just [TF] 17. All. And so obviously, McChrystal would get pissed and then I would have to drive some dickhead to the Green Zone and he’d get released the next day.”

In spring 2009, interrogations of Quds Force and Shi’ite militia detainees revealed that the senior Quds Force operatives were not sneaking across the border into Iraq like their AQI counterparts in Syria, but instead were arriving on commercial flights from Tehran. It was a eureka moment for Task Force 17. U.S. intelligence persuaded the airlines to supply the passenger manifests for each flight from Tehran, which were quickly passed to the Task Force 17 operations center. TF 17 assumed Quds Force operatives would be flying undercover, but within three days the real name of one of its highest priority Quds Force targets showed up on the manifest. It was that man that the Rangers detained as he got into his taxi, flex-cuffing him, and putting him in the back of a Stryker armored vehicle.

What followed typified the challenges that Task Force 17 faced. For a few hours, the task force interrogated the operative, as they had other Quds Force personnel. As usual, however, the detainee’s status as a Quds Force operative meant his detention was brief. Word of his capture was quickly reported up the chain of command and from there to Iraqi prime minister Nouri al-Maliki. “He was handed over to the Iraqis and then he was released the next day,” a Task Force 17 officer said. Maliki then stood Task Force 17 down until it agreed to clear its target list through him daily.

But for a small number of Shi’ite targets, JSOC found a way around the political restrictions by killing its enemies without leaving any U.S. fingerprints. The command did this using a device called the “Xbox.” Developed jointly by Delta and Team 6, the Xbox was a bomb designed to look and behave exactly like one made by Iraqi insurgents, using materials typically found in locally made improvised explosive devices. Its genesis was the training that Delta and Team 6 explosive ordnance disposal (EOD) personnel went through to learn how to disarm the homemade bombs. After capturing some intact on the Afghan and Iraqi battlefields, the EOD troops set about taking them apart. It wasn’t long before they realized they could build them as well.

Most insurgents JSOC killed this way were Task Force 17 targets in southern Iraq—“a variety of folks that were running [the] Quds Force EFP pipeline and stuff in through the south,” a senior special mission unit operator said.

Task Force 17 continued to operate for several years, but was closed down long before U.S. troops left Iraq at the end of 2011. Despite all the challenges the task force faced, it achieved some success, albeit fleeting. “Previously they [i.e., Quds Force] were running in EFPs and U.S. currency by the truckload,” said a Ranger officer. “Post–TF 17 they were using ratlines.”

From RELENTLESS STRIKE: The Secret History of Joint Special Operations Command by Sean Naylor. Copyright © 2015 by the author and reprinted by permission of St. Martin's Press, LLC.