The assailant's motive for killing Colonel Abdisalan Sanyare Owke and his bodyguard at the airport in Galkayo, a city in Puntland, was not immediately clear.
Police detained the assailant and have begun an investigation of the incident, said Mohamed Jama, another police officer working at the airport.
Somalia has been mired in conflict since 1991, but Puntland has been spared most of the violence. It has a dispute with the neighboring semi-autonomous region of Galmudug that has in the past resulted in fighting.
Al-Shabab, the militant group that aims to topple Somalia's Western-backed government in the Horn of Africa state, has become more active in Puntland after being pushed out of its stronghold further south by African Union peacekeepers and the Somali army, officials say.