In this July 2, 2007, file photo, U.S. military spokesman Brig. Gen. Kevin J. Bergner speaks during a press conference in Baghdad, Iraq, near a poster of a senior Lebanese Hezbollah operative Ali Mussa Daqduq. The Lebanese militant has been released from custody. (WATHIQ KHUZAIE/AP)

A Lebanese militant who was among the masterminds of one of the most brazen and deadly attacks on U.S. troops in Iraq has been released from custody, Iraqi officials disclosed Friday, a move that immediately drew ire from American officials.

Ali Musa Daqduq, a former U.S. prisoner in Iraq, was the last high-profile detainee being held there at the request of American officials.

The case has long been viewed as a test of whether Tehran’s leverage over Baghdad exceeds Washington’s. Senior U.S. officials had lobbied Baghdad to find a way to keep him in custody. Iran, which sponsored Daqduq and other Shiite militants in Iraq during the war, had pressed for his release.

A senior Iraqi official who was not authorized to speak on the record confirmed that Daqduq has been released; Daqduq’s lawyer told Reuters that his client had returned to Lebanon.

“This is an outrage,” Sen. John McCain (R-Ariz) told reporters Friday on Capitol Hill. “The families of those who were killed by this terrorist should also be outraged, and appropriate actions should be taken with regards to our relations with the Iraqi government.”

State Department spokeswoman Victoria Nuland said the administration has contacted the Lebanese government on the issue. Calling Daqduq a terrorist, she said, “We are going to continue to pursue all legal means to see that Daqduq sees justice for the crimes of which he is accused.”

Iraqi officials previously argued that they could not hold Daqduq indefinitely because they did not have enough evidence to convict him, although protracted extrajudicial detentions in Iraq remain commonplace. An Iraqi court ordered his release in May, but authorities kept him in custody until this week, presumably in response to U.S. pressure.

Daqduq was a senior operative of Asaib Ahl al-Haq, a Shiite militia that abducted and executed a small team of U.S. soldiers in the southern city of Karbala on January 20, 2007. The sophistication of the operation, which killed five Americans, became the clearest sign that Iran was using Shiite militia groups to wage a proxy war against U.S. forces in Iraq.

Wearing U.S. military uniforms and driving sport-utility vehicles that resembled the ones Americans drove at the time, the assailants entered the governor’s compound where the Americans were staying.

Sam Wyer, an Iraq expert at the Institute for the Study of War, said Daqduq is all but certain to rejoin the ranks of Hezbollah, the Lebanese militant group the United States has designated as a terrorist organization, or an affiliated group.

“Given his history with Lebanese Hezbollah, he most likely will set up shop with them,” Wyer said. “It is extremely likely that he will be back in the game.”

Jabbar Yaseen in Baghdad and Ed O’Keefe contributed to this report.