UN Secretary-General Ban Ki-moon was flying to Baghdad to meet Iraqi prime minister on Thursday.