After the fall of the military government in 1980, his newspapers were returned to him and he was elected a member of the Senate in the general election of that year. As soon as he was elected President of the Republic, Belaunde appointed Ulloa Prime Minister and Minister of Finance. From 1980 to 1982 Ulloa worked to restore the country's credibility with the international financial community ensuring a healthy inflow of foreign loans and carrying out Peru's first ever thoroughgoing tax reform. In August 1982, the Prime Minister and his cabinet were interpellated for almost 50 hours and, despite Ulloa obtained a motion of confidence, he resigned four months later. Ulloa returned to his seat and was elected President of the Senate for the 1984-1985 term. In 1985, he ran unsuccessfully for the Popular Action's Presidential nomination, losing to Javier Alva Orlandini. Instead, he headed the list of Congress' candidates and was re-elected to the Senate for the 1985-1990 term. In the 1990 general election, he was newly elected to the Senate. Ulloa was well-known for being a talented politician, a successful businessman and a reputed playboy and bon vivant. For many years, he was a member of the International Council of the Museum of Modern Art (MoMA)  He died in Madrid in 1992. He married firstly Carmen García Elmore, daughter of Carlos García Gastañeta, a CEO of W. R. Grace and Company. Next he married a Belgian, Nadine van Perborgh, and thirdly in 1978 Isabel Zorraquín, marquise of Mariño, the divorced wife of Vicente Sartorius y Cabeza de Vaca. Lastly in 1987 Ulloa married Princess Elizabeth of Yugoslavia. They separated in 1989, but did not divorce, so Elizabeth became Ulloa's widow when he died in 1992. From 1990 to 1992 he had a close relationship with the Peruvian writer and socialité Maki Miró Quesada.