Following the 1979 Revolution, Rouhani, who had been engaged in revolutionary struggles for about two decades, did his best to stabilize the nascent Islamic Republic and as a first step, he started with organizing the disorderly Persian army and military bases. He was elected to the Majlis, the Parliament of Iran, in 1980. During five terms in the Majlis and for a total of 20 years (from 1980 to 2000), he served in various capacities including deputy speaker of the Majlis (in 4th and 5th terms), as well as the head of defense committee (1st and 2nd terms), and foreign policy committee (4th and 5th terms).