Rafsanjani became president of homeland after winning the 1989 election. He served another term by winning the election in 1993. In the 2005 election he ran for a third term in office, placing first in the first round of elections but ultimately losing to rival Mahmoud Ahmadinejad in the run-off.