The pair were shot inside the airport in Galkayo, a city straddling the border between Somalia proper and the northern self-proclaimed state of Puntland.
The Al Qaeda-linked Shebab group, which has repeatedly attacked foreign targets in recent years, welcomed the killing but denied any responsibility.
The head of counter-piracy in Puntland told reporters that the two victims, whose names were immediately released, were on a visit to discuss Somalia's controversial money transfer system.
"Both were working for the United Nations Office on Drugs and Crime (UNODC) to help deliver a better future for Somalia," British Foreign Secretary William Hague said in a statement, confirming that the other victim was a Briton.
More From This Section
The motives behind the attack were not yet clear nor was there any confirmed report that any arrest had been made.
"Two white men have been shot inside the airport as they got off a plane," local security official Mohamed Mire said.
A security source suggested the attack was carried out by one single gunman wearing a police uniform but a statement by UNODC spoke of "unknown gunmen".
Some accounts from the airport said the pair had been shot close to the immigration office and the killing seemed to be a targeted assassination carried out by two assailants.
The UN Special Representative for Somalia, Nicholas Kay, condemned the killings.
"Our UN colleagues were working in support of the Somali people's aspiration for a peaceful and stable future. There can be no justification for such a callous attack," he said.
The informal value transfer system known as Hawala channels huge amounts of remittances from Somalia's diaspora but has also been suspected of being sued to fund the Shebab and organised crime in the region.