WASHINGTON — After a car bombing in southeastern Iran killed 11 Revolutionary Guard members in 2007, a C.I.A. officer noticed something surprising in the agency’s files: an intelligence report, filed ahead of the bombing, that had warned that something big was about to happen in Iran.

Though the report had provided few specifics, the C.I.A. officer realized it meant that the United States had known in advance that a Sunni terrorist group called Jundallah was planning an operation inside Shiite-dominated Iran, two former American officials familiar with the matter recalled. Just as surprising was the source of the report. It had originated in Newark, with a detective for the Port Authority of New York and New Jersey.

The Port Authority police are responsible for patrolling bridges and tunnels and issuing airport parking tickets. But the detective, a hard-charging and occasionally brusque former ironworker named Thomas McHale, was also a member of an F.B.I. counterterrorism task force. He had traveled to Afghanistan and Pakistan and developed informants inside Jundallah’s leadership, who then came under the joint supervision of the F.B.I. and C.I.A.

Reading the report, the C.I.A. officer became increasingly concerned. Agency lawyers he consulted concluded that using Islamic militants to gather intelligence — and obtaining information about attacks ahead of time — could suggest tacit American support for terrorism. Without specific approval from the president, the lawyers said, that could represent an unauthorized covert action program. The C.I.A. ended its involvement with Mr. McHale’s informants.

Despite the C.I.A.’s concerns, American officials continued to obtain intelligence from inside Jundallah, first through the F.B.I., and then the Pentagon. Contacts with informants did not end when Jundallah’s attacks led to the deaths of Iranian civilians, or when the State Department designated it a terrorist organization. Senior Justice Department and F.B.I. lawyers at the time say they never reviewed the matter and were unaware of the C.I.A. concerns. And so the relationship persisted, even as American officials repeatedly denied any connection to the group.

The unusual origins and the long-running nature of the United States’s relationship with Jundallah are emblematic of the vast expansion of intelligence operations since the terrorist attacks of Sept. 11, 2001. With counterterrorism a national priority, new players — the F.B.I., the Pentagon, contractors and local task forces — have all entered the spy business. The result is a sometimes-muddled system in which agencies often operate independently and with little oversight.

“Every agency wants to be involved in counterterrorism and intelligence now,” said Representative Rush Holt, a New Jersey Democrat who sat on the House Intelligence Committee and said he did not recall being briefed on the Jundallah matter. “We have these Joint Terrorism Task Forces everywhere, and there’s so many of these antiterrorism thrusts in our bureaucracy. There’s so much more going on.”

The C.I.A., the F.B.I., the Pentagon and the office of the director of National Intelligence all declined to comment for this article. But more than half a dozen current and former officials, who spoke on the condition of anonymity because they were not authorized to discuss it, confirmed both American involvement with Jundallah and the way it evolved. Several current officials who discussed the operation played down its significance, attributing it to lapses in oversight, rather than a formal effort to ally with a terrorist group.

Image

MAKING CONTACTS Thomas McHale in Afghanistan.

At the center of the operation was Mr. McHale. Those who know him paint a contradictory picture — someone whose skill in developing sources was highly regarded by the F.B.I. but who bristled at the restrictions of bureaucracy and whose dealings with Jundallah were conducted largely “off book.”

Mr. McHale, 53 and now retired from the Port Authority, refused to comment. A high-school graduate from Jersey City, Mr. McHale became a law enforcement celebrity after 9/11, helping to rescue survivors and recover victims at ground zero, and playing himself in Oliver Stone’s movie, “World Trade Center,” in which Nicolas Cage starred as a Port Authority police officer.

His work on Newark’s Joint Terrorism Task Force took him to Afghanistan and Pakistan, where he helped capture leaders of Al Qaeda alongside F.B.I. and C.I.A. colleagues. He received the Port Authority’s Medal of Honor for bravery in 2006.

“If there’s a new Greatest Generation, then McHale would certainly define it,” The New York Post wrote in a 2011 profile.

But friends say he could be brash and opinionated, the kind of guy who, if he thought your email was stupid, would immediately say so — and copy your boss on the reply for good measure.

“Tommy is not without opinions, and he is generally happy to share them with his colleagues and bosses,” said Don Borelli, a retired F.B.I. counterterrorism supervisor who worked with Mr. McHale in Pakistan but was not involved in the Jundallah matter. “As you can imagine, this has ruffled some feathers, especially at the F.B.I. But when it hits the fan, Tommy is the guy you want on your team working the case.”

Mr. McHale was at home in the fast-paced culture that seemed particularly frenetic after Sept. 11, 2001, when decisions were made and executed on the fly in response to seemingly omnipresent terrorist threats. And after 9/11, information about the Middle East was at a premium. As it happened, Mr. McHale had a source, an informant who had been on the F.B.I. payroll since about 1996, officials said.

The informant lived in the New York area, according to three former officials, but had friends and family in Baluchistan, a sprawling region covering parts of Iran, Afghanistan and Pakistan. The informant introduced Mr. McHale to these overseas connections, which included members of the Rigi family, the namesake of a powerful Baluch tribe based in southeastern Iran.

Image

FOUNDER Abdolmalek Rigi, the founder of Jundallah, after his capture in 2010 by Iranian forces. He was executed later the same year.CreditIranian State Television, via Reuters

The arrangement was promising enough that after 9/11 the informant became a joint F.B.I. and C.I.A. asset, meaning he was supervised by both agencies simultaneously, with Mr. McHale as the point person, officials said.

Southeastern Iran, where the Rigis are based, is the country’s poorest region, a sparse, lawless area where water is scarce and life expectancy is low. The Baluch people, who are mostly Sunni, have long faced oppression at the hands of the Shiite government. Security forces have demolished homes. Sunni leaders have been shot dead in the streets.

Against that backdrop, a charismatic young member of the Rigi family, Abdolmalek Rigi, founded Jundallah — the soldiers of God — to fight the Iranian government in 2003. Its leadership drew heavily from the Rigis. The United States would later estimate that Jundallah attracted 500 to 2,000 members, making it about the size of Al Qaeda’s branch in Yemen.

But in its early years, the group received little attention in Washington. And Mr. McHale’s relationship with the group did not raise concerns, former officials say. In part, they say, that was because the United States did not yet consider Jundallah a terrorist organization and it had stated no intention to attack the West. But they say it was also because one of the government’s leading experts on Baluchistan, and the one most likely to spot the potential problem, was Mr. McHale himself.

Brazen Attacks

Over time, Jundallah grew more brazen. In 2005, its operatives ambushed President Mahmoud Ahmadinejad’s motorcade, failing to kill him. The group was also blamed for a rapid series of attacks, including a massacre at a checkpoint in 2006. The following year, Jundallah carried out the car bombing on a bus full of Revolutionary Guard members.

The extent of the intelligence provided by Mr. McHale’s informant and his overseas network of contacts could not be determined. But Baluchistan serves as a hub for militant groups and smugglers who move drugs, weapons and kidnapping victims across the porous borders of Iran, Afghanistan and Pakistan. Some Baluch fighters share ideological ties with the Taliban and Al Qaeda. Khalid Shaikh Mohammed, the admitted mastermind of 9/11, is an ethnic Baluch. Over the years, information from Mr. McHale’s sources filled huge intelligence files, three officials said.

It is not illegal for government agents to use criminals or terrorists as sources. Developing informants inside Al Qaeda has been a C.I.A. preoccupation since 9/11. But the goal has always been to use those informants to help dismantle Al Qaeda itself. In the case of Jundallah, the objective was to obtain information, former officials said, not to combat the group or stop its attacks.

Current and former officials say the American government never directed or approved any Jundallah operations. And they say there was never a case when the United States was told the timing and target of a terrorist attack yet took no action to prevent it.

Image

CARNAGE A funeral in Zahedan, a provincial capital in southeastern Iran, after a suicide bomb attack in 2010 by the insurgent group Jundallah, in which the United States has informants.CreditIslamic Republic News Agency, via Associated Press

Still, the risk of such arrangements is that atrocities committed by people working with the United States could be seen as sanctioned by the government. In Guatemala, for example, a military officer working with the C.I.A. ordered the killing of an American citizen in 1990. When that came to light, it became a major scandal that forced the C.I.A. to review its entire informant network.

The F.B.I., too, has a checkered history in this area. In one widely publicized case, F.B.I. agents in Boston used the mobster James (Whitey) Bulger as an informant, even as he and his gang committed murder. That scandal led the F.B.I. to rewrite its rules, which now require extensive record keeping and scrutiny of informants who commit crimes.

As an F.B.I. informant, Mr. McHale’s original United States-based source would have been subjected to that scrutiny. But requirements are less onerous for secondary sources, known as “subsources.” So officials acknowledged that there was little oversight of the people inside Jundallah whom Mr. McHale talked to and met abroad.

It is not clear which specific officials authorized the relationship with Jundallah to continue after C.I.A. lawyers raised concerns about it. Lawyers at the Justice Department and F.B.I. at the time say they were unaware of the relationship or the C.I.A. concerns.

But though the government now says Mr. McHale worked as a single operator, there are indications that senior officials knew of and approved of the relationship he developed with Jundallah. For example, in 2008, senior F.B.I. officials in Washington approved a trip Mr. McHale made to Afghanistan, where he met with his network of informants. By rule, the C.I.A. would also have had to approve that trip.

Mr. McHale’s intelligence reports circulated widely throughout the intelligence community, former officials said. In 2009, the C.I.A.’s Iranian Operations Division gave Mr. McHale an award for his work, former officials said. The reason for his commendation is unknown. Dean Boyd, the C.I.A. spokesman, said the agency could not confirm having provided an award and declined to comment further.

By then, the State Department had begun considering whether to designate Jundallah as a terrorist organization. American officials denied repeated accusations by Iran that the United States and Israel were working with the group.

Iranian forces captured Abdolmalek Rigi in February 2010 and executed him that June. But Jundallah was undeterred. That July, two of its suicide bombers attacked the Grand Mosque in Zahedan, the provincial capital in southeastern Iran. Approximately 30 people were killed and hundreds were wounded. Jundallah identified the bombers as Abdulbaset and Muhammad Rigi, relatives of their fallen leader.

Image

CONTACTS Clockwise from top: Thomas McHale at the Memorial Wall at C.I.A. headquarters in Langley, Va., from his LinkedIn page; Mr. McHale with his wife at the premiere of “World Trade Center”; Mr. McHale with Special Forces soldiers in Afghanistan.CreditBottom right, Bryan Bedder/Getty Images

President Obama condemned the carnage. “The United States stands with the families and loved ones of those killed and injured, and with the Iranian people, in the face of this injustice,” he said.

Keeping Ties After Terror

But the United States’s relationship with Jundallah’s leaders, through Mr. McHale and the F.B.I., did not change, even after the State Department formally designated Jundallah a terrorist organization in November 2010. As one of the government’s few experts on the region and the organization, Mr. McHale participated in the internal review that led to the decision, according to current and former officials. The designation did not prompt a review of Mr. McHale’s informants.

“Jundallah has engaged in numerous attacks resulting in the death and maiming of scores of Iranian civilians and government officials,” the State Department declared. “Jundallah uses a variety of terrorist tactics, including suicide bombings, ambushes, kidnappings and targeted assassinations.”

In late 2013, Mr. McHale requested approval to fly to Afghanistan to meet his contacts again, but the F.B.I. denied it. Exactly why — because of objections to the mission or because of governmentwide budget cuts that year — is not clear. By then, however, Mr. McHale’s brusque personality had caught up with him. He had developed a reputation for being difficult to manage, and F.B.I. managers in Newark complained that he did not keep adequate records of his intelligence operation. Friends said Mr. McHale found himself without support.

So instead, he arranged the trip through the Pentagon. Former officials say the F.B.I. did not try to stop him or object to the collaboration. It was his fifth trip to the region. Photos on his LinkedIn page documented the trip, showing Mr. McHale in Afghanistan alongside American Special Forces.

A few months after his return, the F.B.I. forced him off the Newark task force. Officials said recently that it was in part because of his unauthorized trip to Afghanistan.

Mr. McHale returned full-time to the Port Authority, but things had changed there, too. The controversy over Gov. Chris Christie of New Jersey and the lane closings on the George Washington Bridge had led to management changes at the Port Authority, and friends said Mr. McHale lost some of his bureaucratic support. He became embroiled in a bitter fight with the agency, friends and colleagues say, and retired from the agency last spring.

Some federal officials blame Mr. McHale for what they describe as an operation that veered out of control. They said that if the United States and Jundallah had too close a relationship, Mr. McHale’s go-it-alone attitude was to blame.

But friends and former colleagues say this characterization of Mr. McHale as a rogue operator is unfair. They point out that the relationship persisted for more than a decade, and Mr. McHale’s actions were approved and applauded by several United States agencies over those years. “I’m not sure what to say about this case,” said Mr. Holt, who is retiring from Congress this year. “Everything is plausible in the freewheeling intelligence world.”

With Mr. McHale in retirement, the future of America’s involvement with the Rigis is unclear. Jundallah has fragmented. Its followers have joined other militant groups. But officials say that Mr. McHale’s original informant, the one who holds the key to a network of overseas informants, remains on the books as an F.B.I. informant.

A version of this article appears in print on , Section A, Page 1 of the New York edition with the headline: Getting Close to Terror, but Not to Stop It. Order Reprints | Today’s Paper | Subscribe