In 1985 Villanueva was elected to the Peruvian Senate and elected as the President of the Senate from July 1986 to July 1987. During the presidency of Alan García, he served as prime minister from 1988 to 1989. In 1990, Villanueva was elected to his last term in the Senate, from 1990 to 1992 when Alberto Fujimori shut down Congress.