(CNN) -- A U.S.-flagged ship that played a central role in a bloody hijacking drama last spring was attacked again Wednesday, a busy day for piracy in the dangerous waters off the east coast of Africa.



It was the first time a security team aboard a major merchant ship repelled a pirate attack, a top U.S. Navy officer said.



But a defensive weapon that emits a loud noise did not work, Vice Adm. Bill Gortney said in a briefing.



"They tried to employ [a long-range acoustical device] and it did not have the effect," said Gortney, the commander of U.S. Naval Forces Central Command, which is responsible for the area favored by pirates. He said he did not know why the device did not work.



The Maersk Alabama came under automatic weapons fire from pirates about 350 nautical miles east of the Somali coast, the European Union's anti-piracy force said, but fought the attackers off.



The failed attack came on a day of dramatic piracy events: The captain of a ship hijacked Monday was confirmed to have died, even as his ship was used to attack another, and a Spanish prosecutor demanded an investigation into reports that a ransom had been paid for a ship released Tuesday.



The failed attack Wednesday targeted the same ship that was hijacked in the Indian Ocean in April.



Its captain, Richard Phillips, was held hostage on a lifeboat for five days before U.S. Navy snipers shot three pirates dead. A fourth pirate was arrested, and Phillips was rescued.



This time, private security guards on the Danish-owned ship fended off the pirates, EU and U.S. naval sources said. Security had been beefed up on the vessel since the attack in April, Maersk spokesman Kevin Speers told CNN.



The ship's owners did not immediately respond to a CNN question about whether Phillips is still captain of the ship.



Somali pirates vowed revenge for the killing of their compatriots by the U.S. Navy in April, but it was not immediately clear if the Maersk Alabama was targeted intentionally or if the latest attack was a coincidence.



No casualties were reported on the ship, but pirates on land in Somalia feared the pirates who attacked the Maersk Alabama may have been killed or wounded, or may have drowned, they told a local journalist.



There has been no contact with them since they attacked the Maersk Alabama, a pirate in the central Somali town of Harardhere said. Their last communication came while they were battling the security guards on the cargo ship, the pirate said.



Pirates on land also exchanged gunfire -- with one another.



They fought among themselves Wednesday over a multimillion-dollar ransom they received for releasing a Spanish fishing boat, said a local journalist in contact with the pirates.



"There was a heavy exchange of gunfire between some of our friends" one pirate told the journalist, speaking of the other pirates. "They fought over the 3 million euro ($4.5 million) received as a ransom from the Spanish boat."



At least two pirates were wounded in the gunfight in Harardhere, a pirate stronghold in central Somalia, the local journalist told CNN. Those two pirates are in critical condition and have been transferred to the town of Galka'yo.



The Alakrana, the Spanish fishing vessel, was freed Tuesday along with its 36 crew members, Spanish Prime Minister Jose Luis Rodriguez Zapatero said. It had been held for 47 days.



Zapatero did not say how the ship was freed. Spanish media -- including CNN sister station CNN+, which cited a source it said was close to the negotiations -- reported that a ransom had been paid.



A top prosecutor in Madrid on Wednesday called for an investigation into the reported ransom.



National Court prosecutor Jesus Alonso sent a written request for the ransom investigation to Judge Santiago Pedraz, asking that the financial web involved in the alleged payment be untangled, including commissions paid to intermediaries in the negotiations, CNN+ reported from the courthouse.



The prosecutor also called on the judge to take testimony from all the ship's 36 crew members.



Various government ministers have sidestepped questions about whether a ransom was
Who is confirmed to have died? Who called for an investigation? When was the hijack? What are other pirates fighting over? Who calls for an investigation?
The captain of a ship hijacked Monday was Spanish prosecutor last spring the 3 million euro Spanish prosecutor
question: Who is confirmed to have died?, answer: The captain of a ship hijacked Monday was | question: Who called for an investigation?, answer: Spanish prosecutor | question: When was the hijack?, answer: last spring | question: What are other pirates fighting over?, answer: the 3 million euro | question: Who calls for an investigation?, answer: Spanish prosecutor