The fourth pirate was wounded and in custody after a swift firefight, the official said.
Capt Richard Phillips, 53, of Underhill, Vermont, was safely transported to a navy warship nearby.
The official was not authorised to discuss the matter publicly and spoke on condition of anonymity.
A government official and others in Somalia with knowledge of the situation had reported hours earlier negotiations for Phillips’ release had broken down.
The district commissioner of the central Mudug region said talks went on all day Saturday, with clan elders from his area talking by satellite telephone and through a translator with Americans, but collapsed late on Saturday night.
“The reason is American officials wanted to arrest the pirates in Puntland and elders refused the arrest of the pirates,” said the commissioner, Abdi Aziz Aw Yusuf.
Two other Somalis, one involved in the negotiations and another in contact with the pirates, also said the talks collapsed because of the US insistence that the pirates be brought to justice.
Phillips’ crew of 19 American sailors reached safe harbour in Kenya’s northeast port of Mombasa on Saturday night under guard of US navy seals, exhilarated by their freedom, but mourning the absence of Phillips.
Crew members said their ordeal had begun with the Somali pirates hauling themselves up from a small boat bobbing on the surface of the Indian Ocean far below. As the pirates shot in the air, Phillips told his crew to lock themselves in a cabin and surrendered himself.
Phillips was then held hostage in an enclosed lifeboat that was closely watched by US warships and a helicopter in an increasingly tense standoff.
Talks to free him began on Thursday with the captain of the USS Bainbridge talking to the pirates under instruction from FBI hostage negotiators on board the US destroyer.
A statement from Maersk Line, owner of Phillips’ ship, the Maersk Alabama, said “the US navy had sight contact” of Phillips yesterday, apparently when the pirates opened the hatches.
Before Phillips was freed, a pirate who said he was associated with the gang that held Phillips, Ahmed Mohamed Nur, said that the pirates had reported that “helicopters continue to fly over their heads in the daylight and in the night they are under the focus of a spotlight from a warship”.
He spoke by satellite phone from Harardhere, a pirate stronghold, where a fisherman said helicopters flew over the town yesterday and a warship was looming on the horizon.
The fisherman, Abdi Sheikh Muse, said that could be an indication the lifeboat may be near to shore. The US navy had assumed the pirates would try to get their hostage to shore, where they could hide him on Somalia’s lawless soil and be in a stronger position to negotiate.
Three US warships were within easy reach of the lifeboat on Saturday. The pirates had threatened to kill Phillips if attacked.