Almunia was a PSOE Member of the Cortes Generales from 1979 to 2004, representing Madrid. He was the minister of employment and social security from 1982 to 1986. He served as the minister of public administration from 1986 to 1991. He was replaced by Juan Manuel Eguiagaray as minister of public administration.[3] He was also the PSOE spokesperson from 1994 to 1997. Upon the resignation of Felipe González after being defeated in the 1996 elections, Almunia became the party leader from 1997 to 2000. In 2000, he was the PSOE candidate for prime minister, and the party was again defeated by incumbent Prime Minister José María Aznar. The PSOE suffered its worst result in a general election since the Spanish transition to democracy and therefore, Almunia resigned as party leader.