Ali Mohamed Ali never considered himself a criminal, let alone a pirate. He was well-educated. He spoke English. He may have asked his friends in America to send the occasional loan while he lived in Somalia, but he didn’t need to steal or hold innocent people hostage to earn money.

Yet, there he stood in the D.C. District Court on November 4, 2013, a 51-year-old father of one dressed in a blue sport coat and blue-green sweater, a sky blue collar peeking out from underneath. His wire-rimmed glasses rested just below the round birthmark that adorns his forehead. He looked more like the senior member of his defense team—a trio of 30-something lawyers who took on the “once-in-a-lifetime federal” case pro-bono, their inexperience evident with circular cross examinations and presentations of unapproved evidence—rather than the defendant. His head shaved and his white-speckled goatee neatly trimmed, Ali looked unworn by his 30 months behind bars. He was facing life in prison on charges of conspiracy, aiding and abetting piracy and hostage taking in the first international piracy trial held in the U.S. since 1820.

How Ali got here is a story of the increasingly aggressive dragnet that seeks to destroy the piracy business—an enterprise that takes an estimated annual $18 billion bite out of the global economy—and the thousands of suspected pirates that have been locked up in the process. It reveals the depths of piracy’s reach into Somali life, where the line between bystander and accomplice grows thinner by the day. But Ali doesn’t easily fall on either side of that line, but likely somewhere in between.

Somalia’s fractured political system has created an environment for surprisingly organized piracy rings. Despite the election of the country’s first internationally recognized president in more than two decades, areas like Puntland and Central Somalia are just politically stable enough to foster corruption, but not enough for pirates to fear prosecution. These areas are ideal for buying weapons, boats, recruiting young pirates, and securing coastal areas in which to anchor hijacked ships for long periods of time (sometimes months or even years). The World Bank estimates that as much as 86 percent of Somali pirates’ booty goes towards bribing local government officials, businessmen, religious, or clan leaders to keep them from interfering in their trade. Pirate financiers often pay crews far more for grunt work than they could make as a fisherman, and they shell out more money than local ship owners do for meal services, water and energy. These perks alone make piracy a coveted gig—and that’s doesn’t include what the pirates make when they score a ransom, often a payday between $30,000 and $75,000 each for a hijacked ship.

Ali was not what one would typically call a pirate. He never wielded a gun or captured a ship. But on November 9, 2008, he boarded the CEC Future, a Danish cargo vessel that had been seized by Somali pirates while sailing in the Gulf of Aden, off the coast of Yemen. Since he was fluent in English, Ali had been recruited by pirates to negotiate a ransom with the hijacked ship’s owner. After 71 days, the company that owned the CEC Future agreed to pay $1.7 million for the release of 13 hostages—including the captain, who was on his maiden voyage—and the ship’s freedom.

Ali doesn’t dispute these facts. But he says he’s not a pirate conspirator, simply a man trying to do his civic—and particularly Somali—duty to help those in need. If no ransom were paid, he says, the hostages might have been killed. The U.S. government, on the other hand, says his motives were purely material. The government says that even after the $1.7 million ransom had been agreed upon, Ali delayed the release of the hostages to negotiate a separate $75,000 for himself. Ali says that money wasn’t for him, but for two higher-level pirates who demanded extra ransom for themselves. Requests for comment from prosecutors in the U.S. Attorney’s office for this story were denied.

“Mr. Ali wasn’t there for altruism, he wasn’t there for anything good. He was on that ship to get paid,” Assistant U.S. Attorney Julieanne Himelstein told the jury in an impassioned opening statement. “No, he did not go out on a skiff. He did not have a gun. But he did not have to have a gun. His mouth was his gun and that was the most important gun on board, because that’s the gun that got them the money.”

***

Ali Mohamed Ali was born in Yemen on June 26, 1962, but spent most of his childhood in Somalia’s capital, Mogadishu. In December 1981, Ali came to the U.S. on a student visa to study management and economics at the State University of New York, which he attended for three years. He moved from New York to Memphis and then, in 2005, to Washington, DC, where he worked as a taxi driver and spent time socializing and building friendships with fellow members of the capital’s tight knit Somali community.

One of his friends was Abdi Hussein, who described Ali as a “very easy going, very nice guy,” someone who loved to talk about politics, and had a tendency to adjudicate even the smallest disagreements. He was a conflict mediator by nature.

“Very typical Somali,” said Hussein.

Ali allegedly also became a friend of the U.S. government after 9/11, working as an informant for the U.S. Immigration and Customs Enforcement (ICE), a division of the Department of Homeland Security. Defense attorney Matthew Peed said in court that Ali was so helpful that, in 2007, a hearing was arranged to finally get him his green card. He was told he could leave the country, as long as he made it back for his immigration hearing.

In May 2007, however, during a visit to Somalia to see his family, Ali became a single father. His wife left him and Ali, who says he was unclear on the laws about traveling with his son and fearful of getting in trouble, stayed in Somalia. He missed his immigration hearing.

When Ali told his government contacts what happened, he was given no extension, but told to “keep the faith,” Peed said in court. “It was his lifelong goal to become a U.S. citizen and missing that hearing messed it up,” Peed told The Daily Beast. “If he had made it back to the U.S. he would have gotten a Green Card and none of this ever would have happened.”

Stuck in Somalia, Ali never stopped communicating with the U.S. government and would provide intelligence on things like piracy and human trafficking, according to Peed. In the summer of 2008, Ali brokered the freedom of two German yachters who’d been kidnapped and held hostage by Somali pirates while passing through the Gulf of Aden. Immediately after the German couple—who will testify in Ali’s trial—were released, Peed said Ali reached out to the Department of Homeland Security to tell them what had happened. “Keep sharing this information,” someone from DHS allegedly replied, according to Peed. “Let’s set up a meeting.”

“When the CEC Future was hijacked, Ali had an opportunity to get more of the information the U.S. government said was helpful to them,” Peed told the court.

***

“I was told there would be a translator,” Jama Idle Ibrahim told the jury.

Ibrahim is serving two simultaneous sentences of 25 and 30 years for the hijacking of the CEC Future (his first piracy mission) and an attempted attack on a U.S. military vessel. As a part of his plea agreement, he is required to testify in court when needed.

He worked unstable jobs as a fisherman and a construction worker before he entered the piracy business. Despite earning the nickname bare, or “teacher,” for reading to the younger kids when he was in school, Ibrahim only finished eighth grade. On the first day of the trial, he told the court he has seven children that he’s aware of. Ibrahim made between $100 and $1000 a year as a fisherman, but “saw pirates had a lot of money with a lot of cars and beautiful homes.” I want that, he thought. So, in November 2008, when a friend told him he was organizing a piracy mission, Ibrahim asked to join.

At about 2 p.m. on November 7, the CEC Future, a cargo ship owned by a Danish company called the Clipper Group, was carrying steel plates from Belgium to Indonesia when it was seized by pirates in the Gulf of Aden. Ibrahim told the court that when the crew members noticed two skiffs filled with pirates coming toward them, the ship turned toward the Yemeni coast. One of the pirates fired a rocket-propelled grenade toward the cargo vessel, intentionally missing, to scare the crew into stopping. It worked.

The skiffs navigated the high flying waves close to the vessel, which was already low to the water, and the pirates jumped onto the ship.

Once the pirates were on the CEC Future, Ibrahim said they took crewmembers to their rooms to collect cell phones and laptops “so they couldn't communicate with the outside world and tell someone what was going on.” The pirates—with AK 47’s and handguns and communicating “like deaf people” with sign language and hand gestures—herded the terrified group of 13 men into a room.

The pirates ordered the captain to take the vessel to Point Raas Binna, near the Somali coast, an area the prosecutor described as “not a safe haven for pirates.” They waited 15 hours to pick up Ali. The pirates then told the captain to take the vessel to the ancient coastal town of Eyl and drop anchor. Ali immediately began the negotiation process, wasting no time, as the prosecution put it, between getting on the ship with “his expensive suitcases and blindingly white shirt” and calling the Clipper Group to demand $7 million.

The Clipper Group went outside its internal emergency response team and hired a piracy and kidnapping consultant and a freelance negotiator, a man referred to only as “Steven.” As negotiations with Steven dragged on, Ali said he felt more like a member of the captive crew than the pirates’ ally. “The pirates used their guns on him and locked him in a room when they thought they couldn’t trust him,” Peed said.

The ship’s captain, Andrey Nozhkin, testified that his relationship with Ali during the hijacking was “business-like” but also said that they would talk about their families and their homes. “We were not two soulless robots,” he said. Ali instructed him on what to say and how to sound while calling the Clipper Group’s negotiator as pirates pointed a gun at his head. In a recording of the phone call played in court, Nozhkin is heard saying that the pirates were “not bluffing. They’re not joking. The negotiation is finished. You have to make an offer, OK?”

After 60 days on the ship, a fed up and fearful Ali took matters into his own hands. He called Clipper’s CEO Per Gullestrup directly. He’d made this attempt once before, earlier on in the hijacking, but Gullestrup had taken Steven’s advice and ignored the call. This time, he answered, and 10 days later Gullestrup and Ali reached a deal for the release of the ship.

After the CEC Future was released, Peed told the Court, Ali emailed his contacts at the U.S. government yet again, sending links to news stories about the hijacking and even including Gullestrup’s phone number. “That’s not the action of a pirate conspirator, of a hostage taker,” Peed said. In the aftermath of the hijacking, Ali did several media interviews about what happened aboard the CEC Future. He even participated in the documentary Stolen Seas, centered around the CEC hijacking and, specifically, his role in the drama.

“Piracy feeds a lot of people,” Ali says in the film, speaking candidly and unapologetically about his role in the operation. “Piracy has transformed into a well-developed business and I am part of that business.”

Peter Eichstadt met with Ali in Somalia shortly after the hijacking to interview him for his 2010 book, Pirate State. In an interview with The Daily Beast, he recalled Ali’s terrifying description of what happened when the ransom was finally delivered to the CEC Future. The money was packaged in waterproof containers and thrown out of small, fixed-wing aircrafts over the ship. The loot splashed into the water and the pirates scrambled to bring it on board. Ibrahim told the court that Ali was supposed to get $17,000 for his work as the translator, but he never saw him receive any money.

“Ali told me he watched in horror as these men fought on board over the money and continued to fight on the beach, chasing each other and shooting each other, killing others if they thought they hadn’t gotten their fair share of the money,” said Eichstadt. “He shook his head at it.”

Eichstadt said that after several meetings and long talks, he concluded that Ali “wasn’t in this business to make money. He wasn’t a pirate himself, he just wanted to help these people who were clearly in a jam.”

Ali’s friends describe what he did as “really Somalian.” “He spoke English,” explained Abdi Hussein, another one of Ali’s friends. “He’d been in the United States for so long, the least you can do is translate. I would do the same thing if I was back home.”

Hussein Deria met Ali in 2006 at Cafe Nema, a Somali-owned jazz bar and restaurant formerly nestled on the now very hip corner of 14th and U Streets in DC. Ali and his friends used to spend hours at the Somali hangout. Deria, who was born in Somalia but has lived in the U.S. since 1981, drives a taxi full-time and teaches Somali to soldiers on the side. He agrees with Hussein’s belief that Ali was simply doing the right thing.

“When you have people with a language problem, if you speak the language, you try to help them out,” he said. “If not for him there would have been more damage.”

***

A year after he first stepped onto the CEC Future, Ali was carrying on with life, unaware the U.S. government was building a case against him. In June, 2010, Ali was appointed Director General of the Ministry of Education in Somaliland, a self-declared autonomous region within Somalia. Ali’s defense attorney, Brian Brook, told The Daily Beast that Ali received the title because of his efforts to improve schools in the province, with the belief that education is the key to fighting piracy. By the time Ali accepted the position, a warrant had already been issued for his arrest, and another one authorizing police to search his email account.

In March 2011, Ali received an email invitation to attend an education conference in Raleigh, North Carolina. Eager to return to the country he’d once called home, he eagerly made travel arrangements. But he never made it to Raleigh. En route to the conference, that he’d soon discover was a ruse, Ali was arrested at Dulles International Airport in Washington, D.C. Unbeknownst to him, he’d been indicted five days earlier for his role aboard the CEC Future. He was the first person to ever be charged in D.C. for negotiating and receiving a ransom on behalf of pirates.

During her opening statements, Himelstein, the prosecutor, explained to the jury what the terms “hostage taking,” “piracy,” and “aiding and abetting,” mean, to confirm that they had a clear understandings of the charges against Ali. Basically, the government argues, Ali played a major role, to “extort, to manipulate” in order for the pirates—and Ali—to get paid. He’s pleaded not guilty to all of the charges.

Piracy is an international crime and considered such a great threat to the international community that any country, whether or not they have a connection to a particular hijacking, can prosecute those involved. Yet before U.S. ships were targeted, hardly any nation ever did. It was the 2009 hijacking of the Maersk Alabama, the American cargo ship steered by Captain Richard Phillips, followed two years later by the murder of four American yachters by Somali pirates, that motivated the U.S. to start actively pursuing and prosecuting pirates. (Hollywood adapted the Maersk story into Captain Phillips, the 2013 film with Tom Hanks.)

Andrew J. Shapiro, who served as assistant secretary of state for political-military affairs under Hillary Clinton, explains that President Obama’s election coincided with a huge spike in piracy off the coast of Somalia. Ships were transiting without security through the Indian Ocean, near Somalia, and ripe for the picking. “What started as a few ships being attacked turned into a sophisticated network once they saw the big payoffs,” Shapiro told The Daily Beast.

The U.S. led an international effort to fill pirate-heavy zones with naval escorts. This only made pirates more sophisticated, stealing large ships to turn into “mother ships” and moving from the coast of Somalia to deeper into the Indian Ocean. The U.S. made it mandatory that America ships passing through high risk waters have a security team on board. Convincing ships from other countries to use armed security teams was a complicated effort, as many countries don’t legally allow weapons on vessels. But Shapiro regards the increase in ships with security teams as one of the most important factors in the reduction of piracy off the coast of Somalia.

“There have only been two successful hijackings in 2013, which is remarkable when you think of a few years ago,” he said. “Not a single ship with a security team has been successfully attacked by pirates.”

While Shapiro admitted that “political progress in Somalia is the ultimate solution to piracy,” it’s also necessary to disrupt pirate networks. Since revamping its piracy policy in 2009, the U.S. has dedicated its investigators to finding pirate facilitators: the brains behind the operations, typically Somalis, who handle the money that pays for gas, crews, and other expenditures. As of last year, some 1,000 pirates were in custody worldwide, 30 of whom were imprisoned in the U.S.

In pretrial hearings, U.S. District Judge Ellen Huvelle told prosecutors that the U.S. government was “overreaching” in its attempt to pin a piracy charge on Ali. But Shapiro said that from the government’s perspective, Ali is exactly the kind of “facilitator” they’re looking for: someone considered integral to the pirates’ infrastructure.

Nor is Shapiro swayed by the good Samaritan defense. “Are they just mediating, trying to help these poor hostages? Or are they in bed with the pirates?”

*****

Piracy is one of the only crimes not involving death that carries a life sentence for first time offenders in the U.S. By the time Ali’s trial began he’d already spent 30 months in the District of Columbia’s Department of Corrections' Central Detention Facility, a place where conditions are supposedly so bad that one of its longest-serving inmates once claimed that serving nine years there was worse than twenty or more years in a federal prison—save for 10 days he was allowed out on house arrest. Prosecutors had successfully argued that, despite having friends and family in the DC area, no history of violence, nor any real incentive to go back to Somalia, Ali was a flight risk.

“No lawyer would want to have a critical witness under those kinds of conditions,” Ali’s defense attorney Brian Brook told The Daily Beast. “It’s a recipe for disaster.” He also expressed concern that jurors who may have seen the Tom Hanks film Captain Phillips might enter the trial under the false impression that most Somali pirates speak English. This might, Brook feared, convince jury members that a translator like Ali would be unnecessary.

***

Twenty minutes before the opening statements, the pews in the courtroom’s gallery were filled. Somali men and women in brightly colored hijabs along with their teenage children were scattered among several white 20-somethings in suits and pencil skirts, whispering about the technicalities of piracy law. Ali’s family and friends arrived in full force, huddled together in the hallway and the courthouse cafeteria during recesses, not leaving until court was adjourned. Some of them would have to go back to work the next day. Others, like Ali’s lifelong friend Suleiman Salhan, who lives in Maryland, would be there all week. It was the least he could do for his friend of 40 years.

On his way back into the court room after a break, Salhan, who went to school with Ali in Somalia, was feeling good. “He’s going to win,” he said. It was more of a certainty than a prediction, one that all of the friends of Ali’s who I spoke to agreed on: inevitably the court would understand that Ali did nothing wrong, that he was a good man who used what skills he had to help innocent people out of a bad situation.

Five years after he boarded the CEC Future, after 30 months locked up in the country so many said he’d desperately wanted to accept him, five hours after his trial began with weeks or maybe even months to go before a verdict, Ali looked out into the gallery and smiled.

Correction: An earlier version of this article misstated the name of an American cargo ship hijacked in 2009. It was the Maersk Alabama, not the Maersk Alaska.