Right now, a suspected terrorist is sitting in the bowels of a U.S. Navy warship somewhere between the Mediterranean Sea and Washington, D.C. Ahmed Abu Khattala, the alleged leader of the September 2012 attack on the U.S. embassy in Benghazi, Libya, is imprisoned aboard the USS New York, likely in a bare cell normally reserved for U.S. military personnel facing disciplinary action at sea. En route to the United States for more than a week, he’s being questioned by military and civilian interrogators looking for critical bits of intelligence before he’s read his Miranda rights, formally arrested, and transferred to the U.S. District Court in Washington, where he’ll face trial. Meanwhile, the sailors aboard are going about the daily business of operating an amphibious transport ship—even as the ship’s mission has been redefined by the new passenger in their midst.

This isn’t the first time the Navy has played such a critical, curious, and largely under-reported role in U.S. counterterrorism efforts.

In 2011, Ahmed Abdulkadir Warsame, a military commander for the Somali terrorist group al-Shabab, was captured aboard a fishing boat in the Gulf of Aden and detained by the Navy, on the high seas, for two months. In 2013, Abu Anas al-Libi, the alleged mastermind of the 1998 terrorist attacks on American embassies in Kenya and Tanzania, was held aboard the USS San Antonio—an identical ship to the one being used this week. Both men were interrogated at sea before being flown to the United States to face criminal charges in federal courts. Warsame eventually pleaded guilty to nine counts, including providing material support to al-Qaeda in the Arabian Peninsula and teaching other terrorists how to make explosives. Al-Libi pleaded not guilty to terrorism-related charges, and his case is ongoing.

In many ways, it’s not surprising that the U.S. government has been turning Navy assets into floating prisons for these dangerous men. Taking the slow route back to the United States offers interrogators the time and space to gather crucial intelligence from high-value sources like al-Qaeda-linked operatives. During the two months that Warsame was at sea, a select team of FBI, CIA, and Defense Department officials, part of the Obama administration’s High-Value Detainee Interrogation Group, questioned the Somali terrorist on “all but a daily basis.” He was cooperative throughout and some reports suggest that subsequent U.S. counterterrorism operations, including a drone attack in Somalia shortly after his capture, were a direct result of intelligence Warsame provided to authorities. While al-Libi was only detained at sea for about a week—a chronic medical condition prevented him from being held on a ship for an extended period—reports suggest that similar intelligence-collection efforts were underway in his case as well.

The U.S. government has also embraced the approach because it has limited options for holding and interrogating men like Abu Khattala after capture. The Obama administration remains committed to ending detention operations at Guantánamo Bay, Cuba. While the facility is still home to almost 150 alleged terrorists, the United States has not sent any new detainees there since March 2008. Detaining suspected terrorists at other overseas facilities is likewise not an option. For a time, U.S.-run prisons in Afghanistan were a possibility.

But the detention facility in Parwan is now an Afghan-run prison, and using facilities in other countries would raise a host of legal, operational, and humanitarian concerns. Even if U.S. officials were willing to forgo the opportunity to question Abu Khattala before he’s arraigned in federal court and provided with a lawyer, flying alleged terrorists to the United States immediately presents its own set of problems. Seemingly small operational and political considerations about the ways in which the United States transports terrorists captured abroad have major strategic implications, particularly given lingering questions about U.S. rendition efforts under the Bush administration. In this context, the Navy has taken on the role of high-seas prison warden, even as lawyers continue to debate whether and what international legal rules apply to terrorists captured abroad and detained, temporarily, on a ship.

Two years ago, I stood on another U.S. warship as it pulled into the Arabian Sea, similarly tasked with holding dangerous men no one else wanted to hold. The brig below had just been cleared of approximately a dozen alleged pirates who, like Warsame, al-Libi, and Abu Khattala, had yet to stand trial. They had been captured a few weeks earlier, in the midst of attacking a cargo ship, but it was still unclear who could—and would—prosecute them. In the interim, the Navy had imprisoned them in the carrier’s brig—a barren room with a dozen bunk beds and matching small lockers, its gray walls devoid of any marks indicating where on the ship they were located.

Like the guards at Guantánamo, the ship’s burly master-at-arms removed his name tag while the pirates were on board so that they couldn’t identify him. He told me that his men weren’t quite sure what to feed the pirates, or what to give them to read to pass time during their weeks in custody at sea. At least, he noted, the detainees seemed to like getting fresh air on the ship’s flight deck—and the cigarettes and candy bars his sailors provided when the pirates followed the rules. Even more curious was the impact holding these dangerous men had on the carrier as a whole. As one former Navy officer explained to me, “We ended up driving [our] ships up and down the coasts, to keep them [in international waters]. . . . Our operations were driven by having to hold onto these knuckleheads.”

Somali pirates are usually let go if no country is willing and able to prosecute them. In these situations, the Navy has no choice but to put them in life jackets and shuttle them close to the coast on small boats, where they are set free and wade to shore. The alleged orchestrator of the Benghazi attack, on the other hand, will soon face trial in a U.S. federal court. Until then, the USS New York steams west from the Mediterranean. Abu Khattala undergoes questioning. And a Navy sailor wonders what to make a Libyan terrorist for dinner.