The Danish ambassadors to Iran and Indonesia have left those countries due to threats against them over the publication of cartoons of the Muslim Prophet, Danish officials said on Saturday.