Gunmen kidnapped two Libyan diplomats at a market in Somalia's lawless capital on Saturday, but the envoys were later freed, Libyan officials said.
In the first reports from Somalia, a guard at the Libyan Embassy in Mogadishu reported the kidnap.
"They were abducted by men with pistols," said the guard, who asked that his name not be used because he was not authorized to speak to the media.
A Libyan Foreign Ministry statement at that time said "the two were attacked and forced to leave their car" while shopping in Bakara Market, south of the city center.
It identified the diplomats as Naji Gassouda and Fathi Boudiyah, but did not say what positions they held at the embassy.
In the Libyan capital, Tripoli, the Foreign Ministry official who later announced that the diplomats were released said no ransom money was paid, and that the two were freed after unspecified efforts made in the intervening hours.
The official, who spoke on condition of anonymity because he was not authorized to speak to the media, would not elaborate on what efforts were made nor who was involved in negotiating the release.
Libya's Foreign Ministry had summoned the Somali ambassador in Tripoli to protest the abduction and demand Somalia's government work for the diplomats' release, the earlier statement said.
The Libyan Embassy is the only one from an Arab country that has not shut down since a civil war broke out in 1991.
The war-wracked country faces what the UN says is the biggest humanitarian crisis in Africa. The government, with help from neighboring Ethiopia, has been battling a ferocious Islamic insurgency that has killed thousands of people this year.
Somalia has not had a functioning government since warlords overthrew a dictator in 1991, then turned on one another. The present government was formed in 2004 with the support of the UN, but has struggled to assert any real control.