In 1961, Velayeti joined the National Front, a secular party. Following the Iranian Revolution in 1979, he was elected as a member of the parliament from his home town in parliamentary election of that year. He was also a deputy minister of health from November 1980 to July 1981 in the cabinet of Mohammad-Ali Rajai. After winning the presidential election on 13 October 1981, then President Ali Khamenei proposed Velayati as his prime minister to the Parliament of Iran, but Parliament voted against him on 22 October. Khamenei later proposed Mir-Hossein Mousavi, who gained Parliament's approval. In November 1986, Velayati argued that Iran should have diplomatic ties with all countries. During the premiership of Mousavi, Velayati served as the minister of foreign affairs. After the election of Hashemi Rafsanjani as president, he retained his post until 1997, when Rafsanjani's term was ended. He has been an advisor on international affairs to the Supreme Leader of Iran since 1997.
In November 2006, Argentine Judge Rodolfo Canicoba Corra issued international arrest warrants for Velayati, six other Iranians and one Lebanese in connection with the bombing of the Asociación Mutual Israelita Argentina in Buenos Aires, which resulted in the death of 85 people and serious injuries to 151. Velayati has been on the official Wanted list of Interpol since March 2007, for allegations of "Aggravated Murder and Damages" related to the AMIA bombing. The arrest warrant is based on the allegation that senior Iranian officials planned the attack in an August 1993 meeting, including Khamanei, the Supreme Leader, Mohammad Hejazi, Khamanei's intelligence and security advisor, Rafsanjani, then president, Ali Fallahian, then intelligence minister, and Velayati, then foreign minister.
Later years
Velayeti was appointed to the Strategic Council on Foreign Relations in 2006. He appears to be close to Supreme Leader Ali Khamenei, serving as his advisor on international affairs and writing the introduction to Khamenei's book Palestine. He attended funeral service of Imad Mughniyah, who had been killed on 12 February 2008, representing Khamenei on 14 February in Lebanon. On 30 October 2013, Velayati became head of Center for Strategic Research, being appointed by Ali Akbar Hashemi Rafsanjani. He was succeeded by Hassan Rouhani. In November 2019, the United States Tresuary Department has sanctioned Velayati.
Velayati was under consideration by the conservative alliance of Iran as a possible candidate for 2005 presidential election, but he announced that he did not accept candidacy of the conservative alliance and would run as an Independent. He finally decided not to run. It was speculated that he did not want to run against Rafsanjani.
2013 presidential election
He announced his candidacy for the 2013 presidential election and was supported by some conservative groups. He promised a strong external relationship with community reconciliation, and more diplomatic relations with Europe and the United States. He also criticized President Ahmadinejad's foreign policy. He received 2,268,753 of the votes, coming in fifth place.