Three flawless shots. Three pirates killed.

Bracing themselves on a rolling warship in choppy seas, U.S. Navy snipers took down three Somali pirates with three single shots, freeing the American sea captain being held at gunpoint, a Navy commander said Monday.

Angry pirates vowed retaliation for the deaths, raising fears for the safety of some 230 foreign sailors still held hostage in more than a dozen ships anchored off the coast of lawless Somalia.

"From now on, if we capture foreign ships and their respective countries try to attack us, we will kill them (the hostages)," Jamac Habeb, a 30-year-old pirate, told The Associated Press from one of Somalia's piracy hubs, Eyl. "(U.S. forces have) become our No. 1 enemy."

Click to view photos

Sunday's nighttime operation was a victory for the world's most powerful military, but few experts believed it would quell a rising tide of attacks in one of the world's busiest shipping lanes.

The stunning resolution to a five-day standoff came after pirates had agreed to let the USS Bainbridge tow their powerless lifeboat out of rough water. A fourth pirate surrendered after boarding the Bainbridge earlier Sunday and could face life in a U.S. prison. He had been seeking medical attention for a wound to his hand, military officials said.

Interviewed from Bahrain, U.S. Naval Forces Central Command chief Vice Adm. Bill Gortney said the takedown happened shortly after sailors on the Bainbridge saw the hostage-takers "with their heads and shoulders exposed."

U.S. Defense officials said snipers got the go-ahead to fire after one pirate held an AK-47 close to Capt. Richard Phillips' back. Two other pirates popped their heads up out of the lifeboat, giving snipers three clear targets, one official said.

The military officials asked not to be named because they were not authorized to publicly discuss the case.

The Navy released images from an unmanned drone that showed snipers positioning themselves on the fantail of the USS Bainbridge. They fired simultaneously.

"(They are) extremely, extremely well-trained," Gortney told NBC's "Today" show, saying the shooting was ordered by the captain of the Bainbridge.

The SEALS arrived on the scene by parachuting from their aircraft into the sea, and were picked up by the Bainbridge, a senior U.S. official said.

He said negotiations with the pirates had been "going up and down." The official, asking not to be identified because he, too, was not authorized to discuss this on the record, said the pirates were "becoming increasingly agitated in the rough waters; they weren't getting what they wanted."

Just as it was getting dark, pirates fired a tracer bullet "toward the Bainbridge," further heightening tensions, the official said.

News of Phillips' rescue caused his crew in Kenya to break into wild cheers and brought tears to the eyes of those in Phillips' hometown of Underhill, Vermont, half a world away from the Indian Ocean drama. It was not immediately known when or how Phillips would return home.

President Barack Obama called Phillips' courage "a model for all Americans" and said he was pleased with the rescue, but added the United States still needed help from other countries to deal with piracy and to hold pirates accountable.

Sunday's blow to the pirates' lucrative activities is unlikely to stop them, simply because of the size of the vast area — 1.1 million square miles — stretching from the Gulf of Aden and the coast of Somalia. But it could raises tensions in an already lawless area.

"This could escalate violence in this part of the world, no question about it," said Gortney.

A Somali pirate agreed.

"Every country will be treated the way it treats us. In the future, America will be the one mourning and crying," Abdullahi Lami, one of the pirates holding a Greek ship anchored in the Somali town of Gaan, told The Associated Press on Monday. "We will retaliate (for) the killings of our men."

In a move that surprised the pirates, the U.S.-flagged Maersk Alabama had put up a fight Wednesday when pirates boarded the ship. Until then, Somali pirates had become used to meeting no resistance once they boarded a ship in search of million-dollar ransoms.

Ship owners often do not arm their crews, in many cases because of the cargo. A Saudi supertanker hijacked last year carried 2 million barrels of oil, and a gunshot could have triggered an explosion.

As dramatic as each hijacking is, Somali pirates still have only attacked a small fraction of the 20,000 ships that pass through the Gulf of Aden each year. Going around Africa to bypass the pirate-infested gulf can rack up massive costs and add up to two weeks to the voyage.

The pirates still hold about a dozen ships with more than 200 crew members, according to the piracy watchdog International Maritime Bureau.

Vilma de Guzman, whose husband is one of 23 Filipino sailors held hostage since Nov. 10 on chemical tanker MT Stolt Strength, feared Phillips' rescue may endanger the lives of other hostages.

"The pirates might vent their anger on them," she said. "Those released are lucky, but what about those who remain captive?"

She also criticized world media for focusing so much on the U.S. captain but giving little attention to other hostages.

Phillips' 17,000-ton ship docked Saturday with 19 crew in Mombasa, Kenya, and crew there they expected to stay for several days before returning home.

Chief mate Shane Murphy said spoke to Phillips by telephone Monday. "He's absolutely elated and he could not be prouder of us for doing everything we were trained to do," Murphy said.

In Vermont, Maersk spokeswoman Alison McColl choked up as she stood outside the Phillips' family house and read their statement.

"Andrea and Richard have spoken. I think you can all imagine their joy, and what a happy moment that was for them. They're all just so happy and relieved.

"Andrea wanted me to tell the nation that all of your prayers and good wishes have paid off because Captain Phillips is safe," she said.

The American ship had been carrying food aid bound for Rwanda, Somalia and Uganda when the ordeal began Wednesday hundreds of miles (kilometers) off Somalia's eastern coast. As the pirates clambered aboard and shot in the air, Phillips told his crew to lock themselves in a cabin and surrendered himself to safeguard his men.

Phillips was then taken hostage in an enclosed lifeboat that was soon shadowed by three U.S. warships and a helicopter. Phillips jumped out of the lifeboat Friday to try to swim to freedom but was recaptured when a pirate fired into the water, according to U.S. Defense Department officials.

Kenya's foreign minister said his country had not received any request from the United States to try the fourth captured pirate but would "consider it on its own merit."

On Friday, French navy commandos stormed a pirate-held sailboat, the Tanit, in a shootout at sea that killed two pirates and one French hostage and freed four French citizens.