Following the 1979 revolution he became one of the aides of Ayatollah Khomenei. He was named Khomenei's representative at the Iran's Council of National Radio and TV but lost that post after hostage taking opponent Bani Sadr became president and engineered his resignation. He was the spiritual leader of the Muslim Student Followers of the Imam's Line who led the hostage taking of American embassy staff on 4 November 1979. He is reported to have held the post of deputy speaker of the Majles in the early 1980s. He was appointed by Khomenei prosecutor general of Iran, replacing Ayatollah Yousef Sanei in the post in the mid-1980s. Then Khoeiniha was made a member of the Supreme Judicial Council and also, of the Expediency Council. In 1989, he was appointed by Khomenei as his representative in the constitution assembly that was formed to review the constitution.