The 2009 Portuguese legislative election was held on 27 September, to renew all 230 members of the Assembly of the Republic.. The election took place during the regular term of the previous four-year legislative period, following four years under a majority government of the Socialist Party (PS). A total of 13 parties and two coalitions competed in this election.

For the first, and so far only, time in legislative elections in Portugal, one of the candidates from the two main parties for the position of prime minister was a woman.. The Socialist Party, led by then-prime minister José Sócrates, won the largest number of votes and seats, but failed to repeat the overall majority it obtained in 2005.. Despite polling first at 36.6%, the Socialists lost 8 percent of the vote and 24 seats, but still maintained a clear advantage over the conservative Social Democrats, which remained stable at 29%, while the CDS – People's Party and the Left Bloc made strong gains. The communist-led alliance, the Unitary Democratic Coalition (CDU), made minor gains but dropped from third to fifth place.

On 12 October, José Sócrates was invited by President Aníbal Cavaco Silva to form a government. The new cabinet, a minority one, was announced on 22 October and sworn in on 26 October. Due to the sharp increase in registered voters, voter turnout fell considerably, with 59.7% of the electorate casting their ballots, although the number of votes cast was only slightly lower than in 2005.

Background In the February 2005 early election, the Socialists, under the leadership of José Sócrates, won 45 percent of the votes and 121 MPs, the first time ever the Socialists won an absolute majority, whereas the PSD suffered a heavy defeat, achieving their worst results since 1983, and faced with this failure, the then PSD leader and outgoing Prime Minister, Pedro Santana Lopes, resigned from the leadership.

During the first months in his government, Sócrates raised taxes to reduce the deficit and initiated a policy of strict fiscal control. At the same time, he faced a very harsh summer with severe wildfires across the country.. That same October, the Socialists suffered a heavy defeat in the 2005 local elections, winning just 108 cities, a drop of four, against the PSD's 158 mayoral holds, with the party unable to regain control of Lisbon and Porto. In January 2006, a new president was elected, with Aníbal Cavaco Silva, prime pinister between 1985 and 1995, becoming the first center-right candidate to win a presidential election, although only just. The PS candidate, former prime minister and president Mário Soares, polled a disappointing third place with just 14% of the votes. In 2007, a referendum for the legalization of abortion was held. After the failure of the 1998 referendum, the Yes side prevailed winning 59 percent of the votes against the No's 41 percent, making abortion legal in Portugal..

While the deficit reduction had been successful, and with the economy growing around 2 percent of GDP by 2007, the government faced heavy opposition for its policies, particularly from teachers unions.. In March 2008, more than 100,000 teachers protested in Lisbon against Sócrates and his Education minister, Maria de Lurdes Rodrigues..

José Sócrates four-year term was also marred by a series of corruption and sleaze accusations against the Prime Minister himself, with the two main cases being the Independent affair and the Freeport affair.. In the first, Sócrates was accused of obtaining his degree in engineering by irregular means from the Independente University, with this case, plus further irregularities, leading to the closure of the university... Several years later, the Public Prosecution office ruled that Sócrates indeed obtained his degree illegally.. In the second case, the Freeport affair, Sócrates was accused, as environment minister (1999–2002), of allegedly ignoring environmental restrictions, due to interventions from members of his own family, in order to allow the construction of a shopping mall in Alcochete by the British company Freeport.. Regarding this case, the end of a primetime evening news show on TVI network, anchored by Manuela Moura Guedes, also led to accusations of pressure from Sócrates and the PS to end the evening news show, as it had several reports on the Freeport affair and an unfavorable coverage towards the Prime Minister. The Freeport affair was ultimately closed due to lack of evidence..

Entering 2009, Portugal was strongly affected by the 2008 financial crisis and entered in a recession,. alongside the government facing problems in the banking sector, with the collapse of BPP and the bailout and nationalization of BPN, a bank with figures close to President Cavaco Silva... As a result, the government adopted stimulus measures that worsened public finances, increasing the deficit and the national debt.. In the European elections of June 2009, the PSD defied expectations by winning a European election for the first time since 1989, with 31.7 percent of the votes, while the Socialists suffered a huge defeat, obtaining just 26.5 percent of the votes, a drop of 18 points..

Leadership changes and challenges Social Democratic Party Following Santana Lopes exit from the leadership, in the party's congress in April 2005, Luís Marques Mendes became party leader winning 56 percent of the delegates, against the 44 percent of his rival, Luís Filipe Menezes.. The results were the following:

|- style="background-color:#E9E9E9" ! align="center" colspan=2 style="width: 60px"|Candidate ! align="center" style="width: 50px"|Votes ! align="center" style="width: 50px"|% |- |bgcolor=orange| | align=left | Luís Marques Mendes | align=right | 497 | align=right | 56.6 |- |bgcolor=orange| | align=left | Luís Filipe Menezes | align=right | 381 | align=right | 43.4 |- |- style="background-color:#E9E9E9" | colspan=2 style="text-align:left;" | Turnout | align=right | 878 | align=center | |- | colspan="4" align=left|Source:

By 2007, party leader Luís Marques Mendes was being very criticized for his opposition strategy and was left further weakened after the party's disappointing result in the 2007 Lisbon mayoral by-election, where the PSD polled 3rd with less than 16 percent of the votes.. Marques Mendes called a snap leadership election and was challenged by his rival in the 2005 PSD congress, Luís Filipe Menezes.. Menezes easily defeated Marques Mendes. The results were the following:

|- style="background-color:#E9E9E9" ! align="center" colspan=2 style="width: 60px"|Candidate ! align="center" style="width: 50px"|Votes ! align="center" style="width: 50px"|% |- |bgcolor=orange| | align=left | Luís Filipe Menezes | align=right | 21,101 | align=right | 53.6 |- |bgcolor=orange| | align=left | Luís Marques Mendes | align=right | 16,973 | align=right | 43.1 |- | colspan=2 align=left | Blank/Invalid ballots | align=right | 1,279 | align=right | 3.3 |- |- style="background-color:#E9E9E9" | colspan=2 style="text-align:left;" | Turnout | align=right | 39,353 | align=right | 62.42 |- | colspan="4" align=left|Source:

By the spring of 2008, PSD leader, Luís Filipe Menezes, who had been elected in September 2007, resigned after just 6 months in the job.. In the following leadership election, held in May 2008, Manuela Ferreira Leite became the first woman to lead a major party in Portugal,. winning 38 percent of the votes, against the 31 percent of Pedro Passos Coelho and the 30 percent of Pedro Santana Lopes.. The results were the following:

|- style="background-color:#E9E9E9" ! align="center" colspan=2 style="width: 60px"|Candidate ! align="center" style="width: 50px"|Votes ! align="center" style="width: 50px"|% |- |bgcolor=orange| | align=left | Manuela Ferreira Leite | align=right | 17,278 | align=right | 37.9 |- |bgcolor=orange| | align=left | Pedro Passos Coelho | align=right | 14,160 | align=right | 31.1 |- |bgcolor=orange| | align=left | Pedro Santana Lopes | align=right | 13,495 | align=right | 29.6 |- |bgcolor=orange| | align=left | Patinha Antão | align=right | 308 | align=right | 0.7 |- | colspan=2 align=left | Blank/Invalid ballots | align=right | 351 | align=right | 0.8 |- |- style="background-color:#E9E9E9" | colspan=2 style="text-align:left;" | Turnout | align=right| 45,592 | align=right | 59.13 |- | colspan="4" align=left|Source:

CDS – People's Party Party leader Paulo Portas resigned from the leadership following the disappointing result of the party in the 2005 elections, saying that "in no civilized country in the world, the difference between Trotskyists and Christian Democrats is one percent", referring to the result of the BE."Paulo Portas deixa liderança do CDS no rescaldo da noite eleitoral", TVI24, 21 February 2005. Retrieved 21 November 2021. A snap leadership congress was called to elect a new leader. Two candidates were in the ballot:"CDS partido ao meio", Correio da Manhã, 24 April 2005. Retrieved 21 November 2021. Telmo Correia, the preferred candidate of Paulo Portas, and José Ribeiro e Castro, more critical of Portas. Ribeiro e Castro was easily elected"Ribeiro e Castro é o novo presidente do CDS-PP", TVI24, 25 April 2005. Retrieved 21 November 2021. and the results were the following:

|- style="background-color:#E9E9E9" ! align="center" colspan=2 style="width: 60px"|Candidate ! align="center" style="width: 50px"|Votes ! align="center" style="width: 50px"|%

| align=left | José Ribeiro e Castro | align=right | 492 | align=right | 56.0

| align=left | Telmo Correia | align=right | 387 | align=right | 44.0 |- |- style="background-color:#E9E9E9" | colspan=2 style="text-align:left;" | Turnout | align=right | 879 | align=center | |- | colspan="4" align=left|Source:.

In April 2007, former CDS–PP leader Paulo Portas challenged the then party leader, José Ribeiro e Castro, for the leadership and was elected for his former job by a landslide.. The results were the following:

|- style="background-color:#E9E9E9" ! align="center" colspan=2 style="width: 60px"|Candidate ! align="center" style="width: 50px"|Votes ! align="center" style="width: 50px"|%

| align=left | Paulo Portas | align=right | 5,642 | align=right | 74.6

| align=left | José Ribeiro e Castro | align=right | 1,883 | align=right | 24.9 |- | colspan=2 align=left | Blank/Invalid ballots | align=right | 38 | align=right | 0.5 |- |- style="background-color:#E9E9E9" | colspan=2 style="text-align:left;" | Turnout | align=right | 7,563 | align=center | |- | colspan="4" align=left|Source:

Electoral system

The Assembly of the Republic has 230 members elected to four-year terms. Governments do not require absolute majority support of the Assembly to hold office, as even if the number of opposers of government is larger than that of the supporters, the number of opposers still needs to be equal or greater than 116 (absolute majority) for both the Government's Programme to be rejected or for a motion of no confidence to be approved.

The number of seats assigned to each district depends on the district magnitude. The use of the d'Hondt method makes for a higher effective threshold than certain other allocation methods such as the Hare quota or Sainte-Laguë method, which are more generous to small parties.Gallaher, Michael (1992). "Comparing Proportional Representation Electoral Systems: Quotas, Thresholds, Paradoxes and Majorities" Changes to the electoral registration system, approved in 2008, which made registration automatic based on each voter's Identity card, led to a significant increase in the number of registered voters, from 8,9 million in 2005 to 9,5 million in 2009.

For these elections, and compared with the 2005 elections, the MPs distributed by districts were the following: