NAIROBI, Kenya - Somalian pirates attacked the Maersk Alabama yesterday for the second time in seven months and were thwarted this time by private guards on board the U.S.-flagged ship who fired off guns and a high-decibel noise device.

A U.S. surveillance plane was monitoring the ship as it continued to its destination on the Kenyan coast.

Pirates hijacked the Maersk Alabama in April and took ship captain Richard Phillips hostage, holding him at gunpoint in a lifeboat for five days. Navy SEAL sharpshooters killed three of the pirates in a daring nighttime attack to free Phillips.

Yesterday, about 6:30 a.m. local time, four suspected pirates in a skiff attacked the ship again, firing at it with automatic weapons from 300 yards away, a statement from the U.S. Fifth Fleet in Bahrain said.

An onboard security team repelled the attack by using evasive maneuvers, small-arms fire, and a Long Range Acoustic Device, which can beam earsplitting alarm tones, the fleet said.

Vice Adm. Bill Gortney of the U.S. Naval Forces Central Command, said the Maersk Alabama had followed the maritime industry's "best practices" in having a security team on board.

Two former crew members of the Maersk Alabama said yesterday they had asked the company to rename, repaint, or reroute the ship after it was first attacked.

John Cronan, of Merion Station, and Shane Murphy said that they had feared another attack but that the company did not heed their request.

"It was my recommendation to take that ship off the run or change the name or do something," said Murphy, of Seekonk, Mass. "Because, honestly, we have to realize that American seamen are not going to be treated like the rest of the world if they're caught."

Cronan alleged that Maersk officials said such changes would require too much paperwork.

After arriving back home, Cronan said he turned down an offer to return to the ship with a promotion.

"Obviously she's a hot target," he said. "The bad guys were laying in wait for her."

Cronan and several other crewmen have filed suit in Texas against Maersk Line Ltd. and Waterman Steamship Corp., which provides ships' crews, alleging that the companies were negligent in sending the ship into known pirate territory with inadequate protection.

The men are seeking compensation for physical and psychological damage they say they suffered during the spring hijacking, and for loss of income.

Maersk officials could not immediately be reached for comment on the allegations.

Some maritime experts said it was unlucky but not unprecedented that the Maersk Alabama had been targeted in a second attack.

"It's not the first vessel to have been attacked twice, and it's a chance that every single ship takes as it passes through the area," said Cmdr. John Harbour, a spokesman for the EU Naval Force.

"At least this time they had a vessel-protection detachment on board who were able to repel the attack," he said.