The U.S. military captured a Somali terrorism suspect in the Gulf of Aden in April and interrogated him for more than two months aboard a U.S. Navy ship before flying him this week to New York, where he has been indicted on federal charges.

The case represents the Obama administration’s attempt to find a middle ground between open-ended detentions in secret prisons, as practiced by the George W. Bush administration, and its commitment to try as many terrorism cases as possible in civilian courts.

With the capture of Ahmed Abdulkadir Warsame, the administration appeared to split the difference, with military and intelligence officials interrogating him secretly for two months before bringing in law enforcement officials to question him for purposes of an indictment. He is the first foreign terrorism suspect captured by the administration outside the United States and moved to this country for trial.

In flying Warsame to New York before announcing his capture, the administration circumvented likely congressional objections to his transfer here. Congress has barred the administration from moving detainees held at the U.S. military prison at Guantanamo Bay, Cuba, to the United States for trial.

The administration has increasingly utilized counterterrorism tactics, such as attacks from drone aircraft, that have killed an unprecedented number of militants. But there have been no known foreign captures outside the Iraq and Afghanistan war zones, leading critics to charge that valuable intelligence information was being lost. Some lawmakers have questioned where the administration, which has vowed to close the Guantanamo facility, would send any new detainees.

A senior administration official said that no opportunity for capture had been passed up “when the risk to U.S. personnel was deemed acceptable” and that “a long list of terrorists” had been captured by other countries as a result of U.S.-provided intelligence and other assistance.

The nine-count indictment, which was returned under seal by a federal grand jury in the Southern District of New York late last week, does not accuse Warsame of carrying out or plotting attacks against U.S. targets. It charges him with conspiracy and providing material support to two groups the United States considers terrorist organizations: al-Shabab, a militant Islamist group opposed to Somalia’s weak, U.S.-backed government, and Yemen-based al-Qaeda in the Arabian Peninsula (AQAP). Warsame is also accused of weapons offenses related to both alleged conspiracies; conspiracy to teach and demonstrate explosive-making; and receiving military training from AQAP.

The administration has described AQAP as the most “operationally active” affiliate of Pakistan-based al-Qaeda, responsible for the Christmas Day 2009 bombing attempt aboard a Detroit-bound airliner and last year’s cargo plane bomb plot. In recent months, administration officials have described increasing ties between AQAP and al-Shabab, and indications that al-Shabab was expanding its ambitions to target the United States and its allies.

Warsame, said to be in his mid-20s, “clearly served as an important conduit between the two organizations,” which are “directly engaged in plotting against the United States or our interests,” the senior administration official said. Warsame “was in Yemen last year, and this year . . . and helped facilitate contacts between the organizations,” the official said. The White House made available three senior officials Tuesday to brief reporters on the case on the condition that they not be identified by name.

Other U.S. officials, interviewed separately, said Warsame and another individual were apprehended aboard a boat traveling from Yemen to Somalia by the U.S. military’s Joint Operations Command. The vessel was targeted because the United States had acquired intelligence that potentially significant operatives were on board, the officials said. Court documents said the capture took place April 19.

One of the senior administration officials who briefed reporters said that the other suspect was released “after a very short period of time” after the military “determined that Warsame was an individual that we were very much interested in for further interrogation.”

According to court documents, Warsame was interrogated on “all but a daily basis” by military and civilian intelligence interrogators. During that time, officials in Washington held a number of meetings to discuss the intelligence being gleaned, Warsame’s status and what to do with him.

The options, one official said, were to release him, transfer him to a third country, keep him prisoner aboard the ship, subject him to trial by a military commission or allow a federal court to try him. The decision to seek a federal indictment, this official said, was unanimous.

Administration officials have argued that military commission jurisdiction is too narrow for some terrorism cases — particularly for a charge of material support for terrorist groups — and the Warsame case appeared to provide an opportunity to try to prove the point.

But some human rights and international law experts criticized what they saw as at least a partial return to the discredited “black site” prisons the CIA maintained during the Bush administration.

“What we’re seeing in this case is a government that is conflicted about the legal nature of its counterterrorism operations,” said John Sifton, a human rights attorney with extensive experience in detainee cases.

“On the one hand, it detains persons indefinitely, without access to counsel, using questionable Bush-era interpretations of the laws of war. On the other hand,” he said, “it embraces a more sophisticated approach, by indicting suspects, knowing that the Justice Department is better suited to prosecute them than the military.”

“It is not exactly satisfactory, from a legal point of view,” Sifton said.

Initial reaction from Congress was also critical. Rep. Howard P. “Buck” McKeon (R-Calif.), chairman of the House Armed Services Committee, said the transfer contradicted the intent of Congress, which “has spoken clearly multiple times — including explicitly in pending legislation — of the perils of bringing terrorists onto U.S. soil.”

“It is unacceptable that the administration notified Congress only after it unilaterally transferred this detainee to New York City,” McKeon said in a statement.

Warsame was questioned aboard the ship because interrogators “believed that moving him to another facility would interrupt the process and risk ending the intelligence flow,” one senior administration official said.

The official said Warsame “at all times was treated in a manner consistent with all Department of Defense policies” — following the Army Field Manual — and the Geneva Conventions.

Warsame was not provided access to an attorney during the initial two months of questioning, officials said. But “thereafter, there was a substantial break from any questioning of the defendant of four days,” court documents said. “After this break, the defendant was advised of his Miranda rights” — including his right to legal representation — “and, after waiving those rights, spoke to law enforcement agents.”

The four-day break and separate questioning were designed to avoid tainting the court case with information gleaned through un-Mirandized intelligence interrogation, an overlap that has posed a problem in previous cases. The questioning continued for seven days, “and the defendant waived his Miranda rights at the start of each day,” the documents said.

The indictment against Warsame alleges that he aided and conspired with a U.S. national “and an alien lawfully admitted for permanent residence in the United States.”

The Justice Department declined to comment on the reference. One administration official said it did not refer to Anwar al-Aulaqi, a U.S. citizen who is a leading AQAP figure sought in Yemen. In recent years, more than 30 individuals — many of them U.S. citizens or immigrants with Somali roots — have been charged in federal courts in connection with al-Shabab.

Last month, a U.S. aerial drone fired a missile at two al-Shabab leaders who had been involved in preparing plots to strike Europe, U.S. officials said. At least one of the two militant leaders had been in direct contact with Aulaqi.

One senior administration official said the intelligence Warsame provided was “very valuable,” but declined to say whether it was the basis for the drone attack.

U.S. Navy Vice Adm. William H. McRaven alluded to the captures in testimony before a Senate committee last week in which he lamented the lack of clear plans and legal approvals for the handling of terrorism suspects seized beyond the war zones of Iraq and Afghanistan.

At one point in the hearing, Sen. Carl Levin (D-Mich.), the chairman of the Senate Armed Services Committee, referred to “the question of the detention of people” and noted that McRaven had “made reference to a couple, I think, that are on a ship.”

McRaven replied affirmatively, saying, “It depends on the individual case, and I’d be more than happy to discuss the cases that we’ve dealt with.”

Staff writer Peter Finn and staff researcher Julie Tate contributed to this report.