Before landing a role opposite Tom Hanks in the film Captain Phillips, Barkhad Abdi had never acted.

"This was my first time acting, or even thinking about acting," Abdi tells NPR's Arun Rath.

Captain Phillips is based on a true story: the hijacking of the cargo ship Maersk Alabama. Hanks stars as the title character, Capt. Richard Phillips, and Adbi plays Muse, the man who leads the charge against ship and crew.

Abdi was born in Somalia and lived there until he was 7. At 14, Abdi moved from Yemen to Minneapolis, Minn., which is home to tens of thousands of Somalis. He learned about the role from a local TV ad. He says close to 800 people were at the audition. After a long day of waiting, he was asked a few questions and finally was handed a script for the character Muse.

Though some people in his life were worried about how the film would portray Somalia, Abdi says he had to take the opportunity. "I knew it was a true story, so it was just a chance that I could take," he says.

"I hope people understand the culture clash between these very, very different characters, Capt. Phillips and Muse," Abdi says. "One had just, the normal life, you know, he went to school, college, graduated, family, and now he [has] a job. And the other one is just someone that grew up in a war-torn country, that had no hope, no school, no job, no government, nothing."

For his role, Abdi trained for over a month to learning how to handle weapons, maneuver the tiny skiff boat, and, most importantly, he says, to swim. Learning to act was a challenge, too.

At first, Abdi says, it was difficult to relate to Muse, until he dug deep to realize what they had in common. "When I really thought of the actual character — he's a very desperate guy that had this only chance to be something. I relate to him simply because I was born in Somalia."

As a child in Somalia, Abdi says he witnessed a whole year of the civil war, which began in 1991. "I was really blessed to have parents that got me out. Certainly [Muse] did not have that."

"I look at him as someone that had nothing to lose, a ruthless man who has nothing to lose. A man who has nothing to lose is dangerous," Abdi says. "So, that's how I became his character."

As for working with Hanks, Abdi says it was an honor. "I did not expect him to be that nice, honestly," Abdi says. "He's a very humble guy and he's a hardworking man."

Abdi's performance in the film has been praised by critics. It's inspiring for the first-time actor, but he's cautious. "You know, that's what I want to do. I want to give it a chance, and I want to see if this was the only character I can act, or [if] I can act."