The U.S. Fifth Fleet says the raid took place just before dawn Thursday. The German-owned Megellan Star was commandeered by pirates a day earlier.
The Navy statement says nine suspected pirates were taken into custody. No injuries were reported among the vessel's crew or the Marine team.
U.S. warships are part of a 25-nation task force protecting merchant vessels from pirate attacks off the coast of lawless Somalia and in nearby shipping lanes.
Last month, Denmark said a helicopter from one its warships fired warning shots and foiled a pirate attack off Somalia.