A deadly explosion has hit a convoy escorting Somalia 's prime minister in the capital of Mogadishu , but he escaped unhurt and later appeared in public .