Captain of ship seized by pirates that is the subject of a new Tom Hanks film put crew in peril, lawsuit claims.

A new Hollywood film starring Tom Hanks as the ship's captain who heroically volunteered as a hostage to save the lives of his crew from Somali pirates is gaining glowing reviews and Oscar tips.

But a $50 million lawsuit lodged by several of his men claims that in real-life Captain Richard Phillips was no hero but instead risked their lives as he sailed his cargo vessel into pirate-infested waters.

The Sony Pictures movie Captain Phillips, which opens in American cinemas on Friday and in Britain next week, is based on his account of the 2009 attack on the Maersk Alabama cargo vessel.

The stand-off ended when US Navy marksmen shot dead the pirates who were holding the 58-year-old captain captive on a small craft.

Capt Phillips returned home to a hero's welcome and his selfless bravery was lauded by President Barack Obama who said: "His courage is a model for all Americans."

But nearly half the 20 crew members are suing the ship's owner and operator in a case that will be heard by an Alabama court in December. They claim that rather than saving their lives, Capt Phillips' actions put them at risk in the first place.

The lawsuit claims that he ignored warnings from the US and British navies to remain at least 600 miles offshore and was less than 300 miles off the Somalicoast when the pirates attacked.

In the court documents, the crewmen argue that they were "knowingly, intentionally and wilfully" sent into pirate territory to save costs for the company.

The crew is not now commenting because of the court case. But Jimmy Sabga, a crewman, previously told ABC News: "Capt Phillips did not follow orders. The ship was attacked, and he was responsible."

Brian Beckcom, a lawyer for several of the crewmen, said: "Forrest Gump was also a really good movie starring Tom Hanks but like Captain Phillips it was highly fictionalised."

Capt Phillips did not respond to a request for comment but Maersk said that the lawsuits "are without merit".

Charles Sipkins, a spokesman for Sony Pictures declined to comment on the legal action but said the company was "proud" of the research conducted by the film's director, Paul Greengrass, and his team "to bring this incredible story to the screen".

He added: "While there may be differing opinions among those involved, our filmmakers considered a vast amount of information to tell this story, including statements that have been made by crew members in support of Capt Phillips.

"We are enormously proud of this film, which tells this story of bravery and heroism by the crew, the navy and others who defended the ship."