WASHINGTON - Pirates attacked a U.S.-flagged cargo ship off the coast of Somalia with rockets and automatic weapons on Tuesday but failed to board the craft, the ship's owner and the U.S. military said.

The crew of the Liberty Sun was unharmed, but the vessel suffered damage, according to a statement from Liberty Maritime Corp of Lake Success, New York.

The ship immediately requested help from the U.S. Navy, which sent forces, the statement said.

We are grateful and pleased that no one was injured and the crew and the ship are safe, it said.

It was the second attack in a week on a U.S.-flagged ship in the region. On Sunday, U.S. snipers killed three Somali pirates and freed the American ship captain they had been holding hostage for five days.

Liberty Maritime said the pirates fired rocket-propelled grenades and automatic weapons at the vessel, which was carrying U.S. food aid for African nations to Mombasa, Kenya, from Houston, it said.

A U.S. military official said the Liberty Sun was attacked at about 11:30 a.m. EDT (1530 GMT) on Tuesday. The USS Bainbridge was directed to turn around and assist and went to help, the official said.

The pirates had already gone when the vessel arrived three hours later, the official said on condition of anonymity.

The Bainbridge was the same ship that helped rescue cargo ship captain Richard Phillips on Sunday.

Heavily armed pirates from lawless Somalia have been increasingly striking the busy Indian Ocean shipping lanes and strategic Gulf of Aden, capturing dozens of vessels, hundreds of hostages and making off with millions of dollars in ransoms.

Earlier on Tuesday, Somali pirates hijacked two more cargo vessels and opened fire on a third in attacks that were a clear sign pirate gangs have not been deterred by two raids in recent days in which U.S. and French special forces killed five pirates.