U.S. naval forces who were trailing the Americans' captured yacht with four warships quickly boarded the vessel after hearing the gunfire. They tried to provide lifesaving care to the Americans, but they died of their wounds, U.S. Central Command in Tampa, Florida said in a statement.
Fox said in a televised briefing that the violence on Tuesday started when a rocket-propelled grenade was fired from the yacht at the USS Sterett, a guided-missile destroyer which was 600 yards away. The RPG missed and almost immediately afterward small arms fire was heard coming from the yacht, Fox said.
President Barack Obama, who was notified about the deaths at 4:42 a.m. Washington time, had authorized the military on Saturday to use force in case of an imminent threat to the hostages, said White House spokesman Jay Carney.
A total of two pirates, including the one who was knifed, died during the ensuing confrontation - which happened around 9 a.m. East Africa time - and 13 were captured and detained, the Central Command said. The remains of two other pirates who were already dead for some time were also found. The U.S. military didn't state how those two died. It was unclear if the pirates had fought among themselves.
Negotiations had been under way to try to win the release of the two couples on the pirated vessel Quest when the gunfire was heard, the U.S. military said. Fox, asked by reporters about the nature of the negotiations, said he had no details.
He identified the slain Americans as Jean and Scott Adam, of Marina del Rey near Los Angeles, and Phyllis Macay and Bob Riggle, of Seattle, Washington.
The Quest was the home of the Adams who had been sailing around the world since December 2004 with a yacht full of Bibles.
Pirates hijacked the Quest on Friday several hundred miles south of Oman. Fox said mariners are warned about traveling through the area because of the dangers of pirate attacks.
Gen. James N. Mattis, commander of U.S. Central Command, said: "We express our deepest condolences for the innocent lives callously lost aboard the Quest."
In total the U.S. said that 19 pirates were involved in the hijacking of the Quest.
At the Seattle Singles Yacht Club, where Riggle and Macay were well known, Joe Grande said the two were "great sailors, good people. They were doing what they wanted to do, but that's small comfort in the face of this."
Only minutes before the military announced that the four Americans had died, a Somali pirate told The Associated Press by phone that if the yacht were attacked, "the hostages will be the first to go."
"Some pirates have even suggested rigging the yacht with land mines and explosives so as the whole yacht explodes with the first gunshot," said the pirate, who gave his name as Abdullahi Mohamed, who claimed to be a friend of the pirates holding the four Americans.
Graeme Gibbon-Brooks, the head of Dryad Maritime Intelligence, said he was confounded by the turn of events.
"We have heard threats against the lives of Americans before but it strikes me as being very, very unusual why they would kill hostages outright," he said, adding that the pirates must realize that killing Americans would invite a military response.
The military said U.S. forces have been monitoring the Quest for about three days, since shortly after the Friday attack. Four Navy warships were involved, including the aircraft carrier USS Enterprise.
Last week a Somali pirate was sentenced to 33 years in prison by a New York court for the 2009 hijacking of the Maersk Alabama, a U.S. cargo vessel. That hijacking ended when Navy sharpshooters killed two pirates holding the ship's captain.
The killing of the four Americans appears to underscore an increasingly brutal and aggressive shift pirates have been showing toward hostages. The conventional wisdom in the shipping industry had been that Somali pirates are businessmen looking for a ransom payday, not insurgents looking to terrorize people.
Pirates - who currently hold 30 ships and more than 660 hostages - typically win a multimillion ransom for releasing their captives, a huge sum that is shared among investors and pirates. The money is often spent on alcohol, drugs and prostitutes. One ransom paid last year was reported as $9.5 million. Most ransoms are worth several million dollars.
Pirates have increased attacks off the coast of East Africa in recent years despite an international flotilla of warships dedicated to protecting vessels and stopping the pirate assaults.
Mohamed, the pirate in Somalia, told AP that pirate leaders had been expecting the yacht to make landfall soon.
Five cars full of pirates were headed toward the pirate dens of Eyl and Gara'ad in anticipation of the Quest reaching land Monday, he said. Had the four reached land, they may have faced a long hostage ordeal like the 388 days that the British sailing couple Paul and Rachel Chandler spent in the hands of pirates. The two were released in November.
Omar Jamal, first secretary at Somalia's mission at the U.N., sent his condolences to the families of the four Americans and called the deaths a tragic loss of life. Jamal said there is an urgent need to address the piracy problem.
The Adams ran a Bible ministry and have been distributing Bibles to schools and churches in remote villages in areas including the Fiji Islands, Alaska, New Zealand, Central America and French Polynesia.
Associated Press reporter Pauline Jelinek in Washington, D.C., contributed to this report.