Navy SEALs have rescued the American sea captain held by Somali pirates following a swift firefight off the coast of Somalia Sunday, in a dramatic climax to a harrowing days-long ordeal at sea. Captain Richard Phillips is safe and unharmed. Three of the pirates who were holding him hostage were killed. Vice Adm. Bill Gortney, commander of U.S. Naval Forces Central Command, said the pirates, who were armed with AK-47s and small-caliber pistols and had repeatedly threatened to kill Captain Richard Phillips if a ransom were not paid, were pointing AK-47s at their captive. Gortney said the commander of the nearby USS Bainbridge believed Phillips, who was tied up inside the lifeboat, was in "imminent danger" and made a split-second decision when he ordered sailors to fire. Shots were fired, reports CBS News correspondent Kimberly Dozier, but hostage Richard Phillips is safe and was transported to the USS Bainbridge, unharmed and in good condition. Gortney said the pirates were shot from about 25 meters away by snipers on board the USS Bainbridge, which was towing the lifeboat into calmer waters as sea conditions were getting worse. "The sniper's position on the fantail of the Bainbridge observed one of the pirates in the pilot house and two pirates with their head and shoulders exposed,' said Gortney, "and one pirate had the AK-47 leveled at the captain's back. Gortney said the pirates had fired before at Phillips when the captain had made an escape attempt, jumping from the lifeboat into the Indian Ocean on Saturday. Gortney said the White House had given "very clear guidance and authority" to take action if at any time the commander's life was in danger. "They were very, very well trained," Gortney said of the Navy snipers, "and they're not going to take a shot that going to put the hostage at risk. And so we got a good return on their investment tonight. One pirate had surrendered to the Navy and was on board the Bainbridge, helping in what Gortney described as "a deliberate hostage negotiation process" ? one which was not succeeding. That pirate was wounded, stabbed in the hand by a Maersk Alabama crewmember during Wednesday's hijacking attempt. The pirate, now in U.S. custody, is being treated "humanely," said Gortney. "Their counterparts paid with their lives."