Shortly after Mahmoud Ahmadinejad was elected Iran's fifth post-revolutionary president in July 2005, he convened a cabinet meeting for an urgent discussion of one of the issues closest to his heart - the return of the 12th imam. All streams of Islam believe in a divine savior, known as the mahdi, who will appear at the end of days. For many Shi'a Muslims, the 12th imam, Muhammad ibn Hassan, a direct descendant of the Prophet Muhammad, who went into occlusion in the ninth century at the age of nine, is the main object of their faith. Devotion to the 12th imam is particularly prevalent in Iran where the majority of the population are known as "Twelvers." It is an article of faith for Iranian Shi'a that the return of the hidden imam, as he is also known, will be preceded by cosmic chaos, war and bloodshed and then lead the world to an era of universal peace. From the moment he assumed the presidency, Ahmadinejad, who is a dedicated adherent to the cult of the 12th imam, wanted to make sure that everything was ready for the return. At one of his first cabinet meetings, Ahmadinejad told his newly-appointed ministers, "We have to turn Iran into a modern and divine country to be the model for all nations, and which will serve as the basis for the return of the 12th imam." One minister helpfully suggested the government should undertake a program of hotel expansion to accommodate all the visitors that would flock to Iran when the mahdi finally returned. Several months later, while on a tour of the provinces, Ahmadinejad made the outlandish suggestion that the Western powers were so concerned about the mahdi's possible return that they were scouring the world trying to find him, to prevent him returning to Iran and establishing justice on earth. He even made a reference to the 12th imam in his Christmas Day broadcast to Britain on Channel 4. Ahmadinejad's eccentric devotion to the hidden imam would be of only passing interest were it not aligned to some of the other extreme views he has expressed since becoming president. For at about the same time that he was urging his government to lay the groundwork for the return of the messiah, he was also expressing other, more hard-line opinions. When he became president, Ahmadinejad was almost unknown outside Iran. But his uncompromising adherence to the principles of Ayatollah Ruhollah Khomeini's revolution, and his inflammatory views about the West and Israel, were soon exposed for the entire world to see. At a conference held in Teheran shortly after his election titled "The World Without Zionism," Ahmadinejad declared that Israel was a "disgraceful blot" that should be "wiped off the face of the earth." The comments immediately provoked an international uproar, but Ahmadinejad defended himself by insisting he had merely been quoting the words of Khomeini, the founder of Iran's Islamic revolution. "As the imam said, Israel must be wiped off the map." Ahmadinejad's strict adherence to the memory and legacy of Ayatollah Khomeini, the founder and spiritual guardian of Iran's Islamic revolution, is central to understanding the mind-set of one of the world's most controversial leaders, and one who will quickly find himself at the forefront of the security priorities of US President Barack Obama's administration. Ahmadinejad was an obscure and unimportant student when Khomeini launched his bloody and epoch-defining revolution in Teheran 30 years ago. But his entire presidency has been devoted to upholding the fundamental principles of the ayatollah's inheritance, whether it involves exporting the Islamic revolution throughout the Muslim world to places like Gaza or pursuing the development of a nuclear weapons arsenal. Combined with his inflammatory rhetoric and the deep antipathy that Ahmadinejad and the hard-line conservative clerics who maintain him in power feel towards the West, it is hardly surprising that he has earned the unwelcome sobriquet of being the most dangerous man on the planet. To understand what makes Ahmadinejad tick you have to go back to the earliest days of Iran's Islamic revolution in February 1979 when the future president was an enthusiastic, but largely irrelevant, cheerleader for Khomeini's radical agenda. When the revolution was launched in earnest following Khomeini's triumphant return from exile in Paris to Teheran on February 1, Ahmadinejad was a student at Teheran's University of Science and Technology, where he studied development engineering, later specializing in traffic management. After the revolution, Ahmadinejad was a founder member of a militant student group called "Strengthen the Unity," which was dedicated to upholding the deeply conservative Islamic agenda of Khomeini's revolution, including the return of Shari'a. It was this group that, later in 1979, was responsible for occupying the American embassy and holding the 52 staff hostage for more than a year. After Ahmadinejad became president, five former American hostages surfaced to claim that he had been involved in the embassy takeover, although a comprehensive investigation conducted by the CIA was unable to verify their claim. He was, though, one of the central players in the group of student activists responsible for taking over the embassy, a fact that has since been confirmed by senior Iranian government officials who said he worked as a liaison officer between the student occupiers and Khomeini's office. For the poor peasant boy born in the desert town of Aradan in 1956, the experience had a profound effect. In his lowly capacity as the students' liaison officer, Ahmadinejad was nevertheless able to meet Khomeini several times. The ayatollah made a deep and lasting impression on the young Islamic activist. Like many young revolutionaries, Ahmadinejad regarded Khomeini as his political mentor as well as his religious leader. Ahmadinejad's active involvement in student politics also meant that he met many of the other key figures in the Islamic revolution, notably Ali Khamenei, who succeeded Khomeini as the country's supreme leader after his death, and the future president Ali Akbar Rafsanjani, whom Khomeini had nominated as his interlocutors with the students. Ahmadinejad's political development also owes much to his experience as a founder member of the Revolutionary Guards, which were established by Khomeini shortly after his return from exile to safeguard the purity of his Islamic revolution. Khomeini believed this was essential to protect the revolution from the competing ideologies of Iranian communists, socialists and nationalists who were attempting to seize control of the revolution for their own ends following the shah's ignominious departure into exile. Ahmadinejad enthusiastically supported Khomeini's more militant Islamic ideology, and quickly acquired a reputation as a conservative hard-liner who was prominent in championing the virtues of the revolution. He explained that it was vital for Islamists "to defend the totality of the new regime and respond to its needs." Another experience that had a profound effect on the development of the young Ahmadinejad was serving with the Revolutionary Guards on the front line of the war with Iraq during the 1980s. For most of the war he served with the engineers on the Kurdish border. Although his role in the actual fighting was limited, he nevertheless made many important contacts within the Guards, which would later make significant contributions to his rise to power. Ahmadinejad appears to have been inspired to involve himself directly in Iranian politics following the takeover of the country by the reform-minded, pro-democracy moderates in the mid-1990s. The surprise success of Muhammad Khatami in the 1997 presidential election had a particular effect in galvanizing Ahmadinejad and other conservative hard-liners loyal to Ali Khamenei, who believed that many of the founding principles of Khomeini's revolution, particularly its adherence to the strict adherence of Islamic law, were being abandoned. Khatami, a mild-mannered cleric who had twice served as minister of guidance and culture, had previously clashed with the religious establishment by allowing Iran's media and entertainment industry too much freedom. Khatami's election was mainly a protest vote against the economic incompetence and mismanagement displayed during Rafsanjani's eight-year tenure, but the appointment of an Iranian president who genuinely sought to improve relations with the West and move away from the autocratic regime that had dominated the country since the revolution was too much for the hard-liners, who set about actively undermining his government. By now, Ahmadinejad was teaching traffic management at his old university in Teheran and, outraged by Khatami's reform agenda, became politically active, joining the conservative faction of Teheran's city council. Ahmadinejad's links with the Revolutionary Guards, which had become one of the country's most powerful institutions, proved to be an important asset in developing the future president's political profile. Khatami's reelection in June 2001, when the reformists were still able to muster a majority of the vote, served only to encourage the hard-liners in their efforts to destroy the reform movement. In 2003, backed by Khamenei and the rest of the hard-line conservative establishment, Ahmadinejad secured the all-important position of mayor of Teheran, which (Boris Johnson take note) he was able to use as a launchpad for high office two years later. Ahmadinejad's election as president in 2005 owed more to the organizational capabilities of the Revolutionary Guards than his own popularity. From the late 1990s onwards, the Guards had used the same tactics they had developed during the 1979 revolution to crush any hint of popular uprising against the Islamic dictatorship Khomeini had established. In 2003 when, encouraged by the presence of pro-democracy coalition forces in neighboring Iraq, thousands of young Iranians took to the streets to demonstrate in favor of a more liberal system of government, the Guards took to the streets and brutally repressed the protesters' pro-democracy calls. The club-wielding guards stormed the student dormitories at Teheran University and subjected the demonstrators to savage beatings. After three days of pitched battles, Iran's pro-democracy genie had been well and truly put back in its bottle. In retrospect, the regime's successful repression of the 2003 pro-democracy demonstrations was a turning point in Iran's post-revolution political development, as the conservative hard-liners around Khamenei, the supreme leader, realized that their superior organizational network, allied to the Guards' brute force, could easily deal with any challenge the pro-democracy campaigners could mount. On the back of this, the hard-liners set about making sure that Iran's disparate coalition of reformers and liberals would no longer be able to use the nation's democratic institutions as a platform to propagate their views. Consequently, prior to the 2004 parliamentary elections, the Council of Guardians, the body set up after Khomeini's death to protect the purity of the revolution, systematically vetted all the candidates, disqualifying virtually any politician associated with the country's reform movements, thereby ensuring that the hard-liners were able to win a significant majority. The same tactics were employed in the election that awarded Ahmadinejad the presidency the following year, and the Guards were so overenthusiastic in their efforts to ensure victory for Ahmadinejad that they somehow managed to generate six million more votes than there were voters. And now this pattern of state-sponsored vote-rigging is so well-established in Iran, the West is likely to be frustrated in its hope that the Iranian people might be allowed to express their true feelings about Ahmadinejad's presidency in the elections which are due to take place this June. Certainly, caring for the welfare of the Iranian people has not been top of Ahmadinejad's list of priorities in the three-and-a-half years that he has been running the country. From the moment he came to power, Ahmadinejad has positioned himself not as the standard bearer of the Iranian revolution, but as the guardian and heir to Khomeini's revolution. And rather than dedicating his energy to more pressing issues, such as economic reform and adequate social provision, Ahmadinejad has gone out of his way to reignite the flames of militant Islam that so characterized Khomeini's arrival on the world stage 30 years ago. Thus, in the early days of his presidency, Ahmadinejad worked hard to adopt the revolutionary persona that had served Khomeini so well during the early days of the revolution. Ahmadinejad's power base, both in the cities and the countryside, lies with the poor and the dispossessed, the sans-culottes of the revolution, and he spent much of his time touring the provinces seeking to rekindle the flames of the early revolution and return to the values of Khomeini's early years. He often used Khomeini's language to denounce the US and Iran's other perceived enemies, and was highly critical of their opposition to Iran's pursuit of nuclear technology, which he regarded as Iran's "legitimate right." Ahmadinejad's devotion to Khomeini is essential to the West's understanding of the Iranian regime in two critical respects. A key principle of Khomeini's Islamic revolution is that his ideology should be exported throughout the entire Muslim world, irrespective of the traditional divide between Shi'a and Sunni Muslims. This helps to explain Iran's links to the radical Sunni movements Hamas in Gaza and the Taliban in Afghanistan. Exporting the Islamic revolution was enshrined in the Iranian constitution Khomeini helped to draft in 1979, and Ahmadinejad has been one of its most enthusiastic supporters. One of the more telling revelations to come out of Israel's invasion of Gaza has been to expose the level of Iran's support for Hamas which, like Teheran, is totally opposed to any political accommodation with Israel. Before the crisis it was well known that most of Hamas's training and funding came from Iran, and that hundreds of Hamas militants had passed through the Revolutionary Guards' training camps there. But it was the scale of the military technology that Iran had managed to smuggle into Israel through the various underground tunnel networks that was the big surprise. Previously Hamas had been obliged to make do with primitive, home-made Kassam rockets, which have a range of only a few kilometers, to attack southern Israel. But thanks to Teheran, Hamas now has the capability to fire medium-range Grad missiles that can hit major centres of Israeli population such as Ashdod, Ashkelon and Beersheba. Iran's support for Hamas, which has increased significantly under Ahmadinejad, is in many ways a replica of its support for the militant Shi'a Muslim Hizbullah in southern Lebanon. Indeed, it was Ahmadinejad's decision to increase Iran's military support for Hizbullah that provoked the 2006 war with Israel. Nor have Iran's revolutionary activities under Ahmadinejad been confined to intimidating Israel's northern and southern borders. After he became president, coalition commanders in both Iraq and Afghanistan recorded a dramatic increase in Revolutionary Guard activity in trying to undermine coalition attempts to support the pro-Western, and democratically elected, governments. The other important aspect of Khomeini's legacy that has made a major contribution to defining Ahmadinejad's presidency has been the late ayatollah's edict committing Iran to develop nuclear weapons. The origins of Iran's military program can be traced back to a letter Khomeini sent to the nation's military and political establishment just before he signed the cease-fire resolution ending the eight-year war with Iraq in July 1988. In it, he argued that Iran needed to develop nuclear weapons so that it would never again find itself in the humiliating position of agreeing to a disadvantageous agreement, which is how he regarded the cease-fire deal. Since then successive Iranian regimes - including that of the so-called moderate, Muhammad Khatami - have pressed ahead with acquiring the technical capability to develop an atomic bomb, irrespective of the international hostility this program has attracted. As with the Revolutionary Guards' increased activity in exporting the Iranian revolution, since Ahmadinejad was elected there has been a similar rapid expansion of Iran's nuclear program. When Ahmadinejad came to power, Iran's controversial uranium enrichment program at Natanz had been halted as part of Teheran's attempts to negotiate a deal with the West over its nuclear aspirations. Almost immediately, Ahmadinejad ordered all the seals to be broken and for work to resume on uranium enrichment. For good measure, he sacked the team of negotiators who had been working with European diplomats to resolve the impasse, and ordered their replacements to adopt a more aggressive approach in their dealings with the West. Ahmadinejad's more confrontational attitude may have succeeded in increasing Iran's alienation from the West, but it has paid dividends in terms of the tangible progress Iran has made in developing its nuclear capability. Unless Teheran has a radical change of heart, most Western intelligence experts believe Iran will have enough enriched uranium to build an atom bomb by the end of this year. The prospect of a nuclear Iran, given its well-documented support for Islamist-inspired terrorism, is terrifying enough. But add to this Ahmadinejad's apocalyptic vision of the world, which is all part of his belief in preparing the way for the return of the 12th imam, and it is obvious why resolving the Iran crisis is the most pressing security issue facing the Obama administration that took office in Washington last month. The new American president is keen to establish a dialogue with Teheran, and Ahmadinejad himself made some encouraging noises towards Obama following his convincing election victory last November, offering his personal congratulations - the first time Iran has issued an official goodwill message to an American leader since the 1979 revolution. But the impact of Ahmadinejad's gesture was immediately undermined when an editorial in the government-owned Kayhan newspaper declared that the "Great Satan's" face had changed color, but no more. "Obama's view on talks with Iran is not strategic, it is a hostile tactic," the newspaper warned in an editorial marking the anniversary of the storming of the American embassy in Teheran in 1979. "He does not regard talks as a means to reach a solution, but as a way to increase pressure on Iran." Obama may well want to improve relations with Iran. But even his considerable powers of persuasion are unlikely to break through the mind-set of a regime that remains steadfastly committed to upholding the banner of radical Islam and implementing the legacy of Khomeini's revolution. This piece originally appeared in the February 2009 issue of Standpoint. Reprinted with permission.