U.S. military officials said the kidnapped captain of the U.S. container ship seized by Somali pirates has been rescued, according to a statement by the shipping company.

[efoods]Three pirates were killed in the operation to free Captain Richard Phillips the fourth pirate was taken into custody, the BBC reported on its Web site. Phillips was said to be unhurt and aboard the USS Bainbridge, a warship sent to track the pirates holding him, the BBC report said.

The heavily armed pirates took control of the 17,000-ton relief cargo vessel Maersk Alabama Wednesday.

Phillips offered himself as a hostage to save his 19-man crew, and had been drifting in a lifeboat near northeastern Somalia. The vessel pulled into port in Mombasa, Kenya on Saturday evening.