The mood was tense. On Saturday night, pirates fired shots after a Navy launch approached the boat and the Navy withdrew.
Also on Saturday, a U.S. official said today, the pirates shot their guns next to Phillips' head.
Officials said Saturday evening that the covered lifeboat was 20 miles from the coast, and the pirates had fuel onboard, contrary to previous reports.
If the lifeboat had gotten to shore, it would have been much more difficult for the U.S. military to follow Phillips' whereabouts.
On Saturday evening local time, Phillips' freighter, the Maersk Alabama, pulled into port in Mombasa, Kenya, with its crew members waving and pumping their fists.
The 17,000-ton ship, with 19 crew members onboard, was flanked by escort boats and helicopters flying overhead.
Several of the crew members said the captain had saved their lives. When asked how, one said he'd traded himself for the safety of the crew.
"He saved our lives!" second mate Ken Quinn, of Bradenton, Fla., declared after he walked off the ship, according to The Associated Press. "He's a hero!"
One crew member said his friend stabbed a pirate with his knife. As he told the story, his friend, a crew member, showed off his knife.
A crew member flashed a thumbs up sign and one said he was looking forward to having a beer. Some crew members wore bulletproof vests.
Back home in the United States, news of the Alabama's safe arrival in port sparked joy and relief.
In Buzzard's Bay, Mass., Capt. Joseph Murphy spoke to his son, Shane, by telephone.
"It's a thousand Christmas gifts," he said Saturday. "It's that connection to your child and someone that you've reared when you know they're out of harm's way. There's no expression to tell you that relief as a parent."
The high-seas drama settled into a standoff after the pirates boarded the container ship Maersk Alabama Wednesday while firing AK-47 assault rifles, but were forced off the ship a short time later by the unarmed American crew, which captured one of the pirates.
Phillips apparently prevented a bloody counterattack by the pirates by offering himself as a hostage. A prisoner exchange was arranged, but the pirates didn't keep their part of the bargain and refused to let the captain go free.
After the escape bid on Friday, the pirates threatened to kill Phillips if the U.S. Navy attempted to rescue him.
The Maersk Alabama was in Somali waters because it was carrying food aid to hungry people in Africa, including Somalia.
ABC News' Jim Sciutto, Martha Raddatz, John Hendren, Jake Tapper and Jason Ryan contributed to this report.