A UN mission spokesman said it was not clear who was behind the killings. But one witness said the pair were attacked by a man in a police uniform while they sat in their car at Galkayo Airport.
Abdi Idris, an official in the semi-autonomous Puntland region which administers the airport, gave the nationalities of the two men and said they worked as consultants for the UN anti-drugs agency.
The UN, which has spent billions of dollars in Somalia since the outbreak of civil war in 1991, has often been targeted by warring clan factions, most recently by Al Qaeda-aligned Islamist group al Shabaab.
Somalia's Puntland regional has traditionally been more stable than the rest of the country but in recent months attacks there by al Shabaab militants have increased.
The Islamist group "welcomed the killing" but declined to comment when asked if it was responsible.
Nicholas Kay, the UN Special Representative for Somalia, condemned the "callous" killing but said the organisation remained "committed to continuing our vital support to the Somali people"