The party, under Felipe González, formed a majority government after its victory in the 1982 election which lasted until 1993, after which it formed a minority government until 1996. The PSOE has had strong ties with the General Union of Workers (UGT), a Spanish trade union. For decades, UGT membership was a requirement for PSOE membership. During the 1980s, though, UGT criticised the economic policies of the PSOE, even calling for a general strike on 14 December 1988.[13]

The ideology of the Spanish Socialist Worker's Party has evolved throughout the 20th Century according to relevant historical events and the evolution of Spanish society.

In 1979 the party abandoned its definitive Marxist theses at the hands of its then secretary general Felipe González, not before overcoming great tensions and two Congresses, the first of which preferred to maintain Marxism. Before this situation, notable internal leaders like Pablo Castellano or Luis Gómez Llorente founded the internal faction of Left Socialists, which included the militants who would not renounce Marxism. This allowed for the consolidation of the leftist forces in the PSOE. From this moment, the diverse events both outside and within the party led to projects that resembled those of other European social democratic parties and acceptance of the defence of the market economy.

The PSOE was founded on 2 May 1879 in the Casa Labra Pub (city of Madrid) by the historical Spanish workers' leader Pablo Iglesias.[13] The first program of the new political party was passed in an assembly of 40 people, on 20 July of that same year. Although the PSOE was rather weak during the late 19th century, its active participation in strikes from 1899 to 1902 and especially its electoral coalition with the main Republican parties led in 1910 to the election of Pablo Iglesias as the first Socialist representative in the Spanish Cortes.

The dictator Francisco Franco banned the PSOE in 1939, and the party was legalized again in 1977. During Franco's rule members of the PSOE were persecuted, with many leaders, members and supporters being imprisoned or exiled and even executed.

Its 25th Congress was held in Toulouse in August 1972. In 1974 at its 26th Congress in Suresnes, Felipe González was elected Secretary General, replacing Rodolfo Llopis Ferrándiz. González was from the "reform" wing of the party, and his victory signaled a defeat for the historic and veteran wing of the Party. The direction of the party shifted from the exiles to the young people in Spain who hadn't fought the war.[13]

Llopis led a schism to form the Spanish Socialist Workers' Party (historic) González showed intentions to move the party away from its Marxist and socialist background, turning the PSOE into a social-democratic party, similar to those of the rest of western Europe. In 1977 PSOE became the unofficial opposition leading party with 29.2% of the vote and 118 seats in the Parliament (which until then it had been the Communists, leading more aggressively among a larger representation of underground parties since the last free popular vote during the Civil War on Republican territory) in what was still a pluralistic party election but heading towards a de facto two-party system. Their standing was further boosted in 1978 when the 6 deputies of the Popular Socialist Party agreed to merge with the party.

In their 27th congress in May 1979 González resigned because the party would not abandon its Marxist character. In September the extraordinary 28th congress was called in which González was re-elected when the party agreed to move away from Marxism. European social-democratic parties supported González's stand, and the Social Democratic Party of Germany granted them money. The PSOE party symbol was changed from the anvil with the book to the social-democratic rose in the fist, as used by the French Socialist Party. In the referendum of 1978, PSOE supported the Spanish Constitution, which was approved. In the 1979 Spanish general election the PSOE gained 30.5% of the vote and 121 seats, remaining the main opposition party.

1980 PSOE Anti-NATO billboard. While opposing Spanish membership to NATO when they were on opposition, the party changed its posture in government, and supported the "Yes" option on the 1986 NATO membership referendum.

Though the party had previously opposed NATO, after reaching the government most party leaders supported keeping Spain inside the organisation. The González administration organised a referendum on the question in 1986, calling for a favourable vote, and won. The administration was criticised for avoiding the official names of North Atlantic Treaty Organisation and NATO, using the unofficial Atlantic Alliance terms. A symbol of this U-turn is Javier Solana who campaigned against NATO but ended up years later as its Secretary General.

PSOE Supported the United States in the Gulf War (1991). The PSOE won the 1986, 1989 and 1993 general elections. Under the Gonzalez Administration, public expenditure on education, health, and pensions rose in total by 4.1 points of the country's GDP between 1982 and 1992.[17]

Economic crisis and state terrorism (GAL) against the violent separatist group ETA eroded the popularity of Felipe González, and in 1996, the PSOE lost the elections to the conservative People's Party (PP). Between 1996 and 2001 the PSOE weathered a crisis, with Gonzalez resigning in 1997. The PSOE suffered a heavy defeat in 2000 (34.7%).

On 14 March 2004, the PSOE won the 2004 Spanish general election with almost 43% of the votes, following the 11-M terrorist (11 March) attacks, and maintained their lead in the elections to the European Parliament.

On 9 March 2008 the PSOE won the 2008 Spanish general elections again with José Luis Rodríguez Zapatero remaining Prime Minister of Spain. The Socialists increased their share of seats in the Congress of Deputies from 164 to 169 after the latest election.

However, after waning popularity throughout their second term, mainly due to their handling of the worsening economic climate in Spain in the aftermath of the 2008 Global Financial Crisis, the PSOE were defeated in the general elections of November 2011 by the conservative People's Party.[citation needed] Shortly after, an extraordinary congress was held, in which Alfredo Pérez Rubalcaba, former Deputy to Zapatero and Minister of the Interior, was elected Secretary General defeating Carme Chacón, the other candidate, who stood for the Zapatero platform. This victory caused huge internal divisions and weakened the party's external image.

In 2013, the PSOE held a political conference which introduced a completely new platform, widely seen as a move to the left in a desperate attempt to steal votes from parties such as United Left, whose popularity rose steadily due to the general discomptent against the two-party system and spending cuts. That platform was the basis for the European Parliament election manifesto, promoted as a solid alternative to the conservative plan for Europe. The expectations inside the party, which chose Elena Valenciano as their election candidate, were really optimistic; however, the social democrats suffered another huge defeat due to the appearance of new parties which managed to gain the support of left-wing voters, e.g.: Podemos; the PSOE won 14 seats. Shortly thereafter, Rubalcaba resigned as Secretary General and an Extraordinary Congress was convocated. This congress was the first to use a primary election system with three candidates: Pedro Sánchez, Eduardo Madina and José Antonio Pérez-Tapias. Pedro Sánchez was elected with 49 percent of the vote of the affiliates and therefore became Secretary General on 27 July.

Baron: Unofficial term for the party's regional leaders. They can be very powerful, especially if they run an autonomous community. There have been conflicts between barons and the central directorate in the past. Some barons were Pasqual Maragall (Catalonia), who didn't run for re-election in 2006; Juan Carlos Rodríguez Ibarra (Extremadura), who didn't run for re-election in 2007; Manuel Chaves (Andalucia), who renounced Andalucia's presidency in 2009 to assume Third Vice Presidency of the Spanish Government; José Montilla (Catalonia), now opposition leader. The term barón is more colloquial than official, representing the great power regional leaders have in the party, but it has been falling out of use since 2008.[citation needed]

Compañero ("companion", "comrade"): A term of address among Socialists, analogous to the English comrade.

Currents: There have been several internal groups within PSOE, based on personal or ideological affinities. Some of them have ended with separation from the PSOE. The failed trial of primary elections for PSOE candidates was an attempt to conciliate currents. Examples of currents are "Guerristas" (followers of Alfonso Guerra), "Renovadores" (renewers, right wing of the Party) or Izquierda Socialista (Socialist Left).