Rouhani returned to Iran after the Iranian Revolution of 1978–79. He was elected to the legislative assembly, known as the Majles, serving five consecutive terms between 1980 and 2000. In 2000 he was elected to the Assembly of Experts, and he was reelected in 2007 and 2016.