During his campaign, Ghalibaf not only took off his uniform and replaced it with a slick brown suit, but he also introduced himself as "Doctor" and "Captain" instead of "General." In his electoral posters, Ghalibaf stood next to an Airbus jet, hoping to signal that he is up to date enough to be the president of a new generation of Iranians . Nonetheless, in spite of all predictions and polls, Mahmoud Ahmadinejad was elected president, with Ghalibaf coming in fourth. However, this bitter defeat did not deter Ghalibaf from pursuing his political ambitions. Soon afterward, he became the mayor of Tehran — Ahmadinejad’s previous position — with his eyes ever fixed on the presidential palace.

As the 2005 presidential election was approaching, Ghalibaf sought to portray himself as a moderate and reform-minded person, with an eye on the votes of younger voters. After announcing his candidacy, Ghalibaf spoke about policies such as the detente with the world, which was already being pursued by Khatami. He even accompanied Reformists in attacks on Ayatollah Hashemi Rafsanjani, who was considered an enemy of the Reformists back then.

Following the 1999 student protests in Tehran, Supreme Leader Ayatollah Ali Khamenei appointed Ghalibaf as the new chief of Iran’s police. This was a major turning point in Ghalibaf’s career, as he initiated reforms aimed at modernization. These measures included the ”Police 110” project, which sought to make the police more accessible to the general public, and the replacement of old cars with new Mercedes vehicles, giving a fresh face to the Iranian police.

Ghalibaf started his career in fatigues during the 1980-88 Iran-Iraq War, when he led a division. After the war, he gradually took steps toward political power. In 1997, the year Reformist Mohammad Khatami was elected president, he was appointed as head of the Islamic Revolutionary Guard Corps’ Aerospace Force.

As the 2013 presidential election neared, Ghalibaf — who had focused all of his energy on modernizing Tehran for years — was confident that he, at the very least, had the votes of the residents of the capital. This time, he did away with liberal remarks and sought to regain the votes of conservatives alienated by his campaign slogans in 2005. Hence, he adopted the motto "Jihadi Management," re-labeling himself as a "General" and a member of the paramilitary Basij. Wearing a keffiyeh around his neck, he put away suits and planes, and visited the subway in an attempt to show that he leads a simple life. Ghalibaf’s efforts almost bore fruit; he was the front-runner in most polls, until the televised debates. As he was trading barbs with Hassan Rouhani on foreign policy, past student protests and the then-stalled nuclear negotiations with the six world powers, the Tehran mayor did not know that he was losing the game yet again.

"Mr. Ghalibaf, I did not like to reveal this, but you forced me to. [At the Supreme National Security Council session on the student protests] you said: 'Let the students come to the streets so we can finish the job,'" Rouhani said to Ghalibaf in front of millions of viewers.

This exchange was a major blow to Ghalibaf, as the polls after the debate showed him losing votes as Rouhani gained support. Moreover, none of the conservative candidates, except Gholam Ali Haddad Adel, withdrew in favor of their ideological peers. The conservative vote was thus split, and the two most important conservative factions, the Society of Seminary Teachers of Qom and Combatant Clergy Association, decided to go with Ali Akbar Velayati, showing they still did not have full trust in Ghalibaf.

Undeterred by his defeat, the Tehran mayor set a new plan in motion after the 2013 vote. It is pillared on avoidance of open criticism of Rouhani to avoid losing the votes of the young, enhancing his ties with conservatives — especially those who preferred Velayati — and also moving forward in a more organized fashion.

In keeping with this plan, Ghalibaf has not made any public statements against Rouhani during the past two years. Instead, he appears to have adopted an implicit approach. Last year, anti-American billboards seen as opposition to the nuclear negotiations appeared in Tehran. The municipality controls these billboards. Meanwhile, some of Ghalibaf's remarks at a private meeting, in which he harshly criticized Rouhani, have been leaked, without being dismissed by the Tehran mayor.

Reformist lawmaker Dariush Qanbari told Al-Monitor, "Ghalibaf belongs to the conservative camp. The billboards he put up in the streets are in line with his real train of thought. After the [2013 presidential] election, given Rouhani's popularity, Ghalibaf decided not to slam him but maintained a mild negative rhetoric toward the president to be welcome among conservatives."

In a move seemingly aimed at attracting conservatives and the religious strata of Iranian society, Ghalibaf has announced plans to enforce gender segregation in Tehran municipality offices. Yet, some important segments of the conservative camp still don’t have faith in him. Indeed, he hasn’t been invited to meetings on the formation of a coalition.

Having been defeated twice in the presidential polls, Ghalibaf seems to have come to the conclusion that, given the lack of consensus among conservatives and his failure to gain the favor of the conservative camp, he needs a party of his own. Indeed, on Aug. 19, Ghalibaf adviser Issa Kakoui confirmed reports about the Tehran mayor’s intention to form a political party.

Kakoui has been announced as the head of the Iranian-Islamic Freedom Party but is apparently only the figurehead while Ghalibaf pulls the strings. Reports say Ghalibaf is hoping to win 30 seats in the February elections.

In an interview with Al-Monitor, conservative political activist Abolqasem Raoufian said, "The establishment of a party means Ghalibaf has a plan for the parliamentary elections. It also shows that, contrary to the advice of senior leaders, the conservatives are still divided."

Qanbari, the Reformist member of parliament, told Al-Monitor, "Ghalibaf’s formation of a party shows there are gaps in the conservative camp, and he has decided to go forward on his own to get his share in the elections."

Ever ambitious, it appears that Ghalibaf now sees the path to the presidential palace as going through parliament. Regardless of whether his plans for the parliamentary elections will materialize, they will surely influence his decision on whether to run for office in 2017 and his ability to lock in votes for the presidential election.