What a surprise : in the race for the mostly meaningless position of president of Iran , Mahmud Ahmadinejad , the conservative hard-line mayor of Tehran , came in second place , and will be in a runoff on Friday with Ali Akbar Hashemi Rafsanjani , the former two-term president .