MANAMA, Bahrain (CNN) -- U.S. Navy snipers fatally shot three pirates holding an American cargo-ship captain hostage after seeing that one of the pirates "had an AK-47 leveled at the captain's back," a military official said Sunday.

The captain, who'd been held in a lifeboat in the Indian Ocean since Wednesday, was rescued uninjured, Navy Vice Adm. Bill Gortney told reporters.

Capt. Richard Phillips' ship, the Maersk Alabama, was stormed by pirates 350 miles off Somalia on Wednesday morning. He was "resting comfortably" on the USS Boxer after his rescue Sunday night, according to the Navy.

Phillips contacted his family and received a routine medical exam after his rescue at 7:19 p.m. (12:19 p.m. ET), the Navy Central Command said. Video from aboard the Boxer showed a smiling Phillips shaking hands with Navy personnel.

"The captain is in good health. He's showered up and in a clean set of clothes," Gortney said in a telephone news conference from Navy Central Command in Bahrain.

In Phillips' hometown of Underhill, Vermont, Maersk spokeswoman Alison McColl said Phillips' wife, Andrea, had spoken to her husband by phone after his rescue.

"She was laughing while she was on the phone with him," McColl told reporters. "She was saying his trademark sense of humor was still very much intact, and he's in great spirits. If you guys could have seen her light up when she talked to him, it was really remarkable." Video Watch spokeswoman read statement from Phillips' family »

U.S. forces moved to rescue Phillips after seeing him in imminent danger on the lifeboat, Gortney said. A fourth pirate was negotiating Phillips' fate aboard the nearby USS Bainbridge.

"While working through the negotiations process tonight, the on-scene commander from the Bainbridge made the decision that the captain's life was in immediate danger, and the three pirates were killed," Gortney said. "The pirate who surrendered earlier today is being treated humanely; his counterparts who continued to fight paid with their lives."

The three pirates, who were armed with AK-47 rifles, were killed by shooters who were aboard the Bainbridge, Gortney said.


The on-scene commander gave the shooters approval to open fire after seeing that "one of the pirates had an AK-47 leveled at the captain's back," Gortney said.

Seas in the area were getting rough at the time of the rescue, Gortney said, and the Bainbridge was towing the lifeboat presumably to calmer waters with a towline about 82 feet long.

A senior defense official told CNN that each pirate was shot in the head.

After the shooting, special operations personnel shimmied along the tow rope to ensure the pirates were dead and freed Phillips, the official said.