Voting has begun in Spain's snap general election, with Socialist Prime Minister Pedro Sánchez facing a strong challenge from the conservative People's Party. The election takes place eight months ahead of schedule after Sánchez called an early vote following parliament's rejection of proposed changes to the country's housing laws.

Opinion polls have put Alberto Núñez Feijóo's People's Party, known as the PP, narrowly ahead of Sánchez's PSOE. Despite that gap, Sánchez told supporters on Friday that he remained confident a victory was possible. The contest also places attention on the far-right Vox party, whose backing the conservatives may need to secure a parliamentary majority.

Millions of Spaniards can vote until 20:00 local time, or 19:00 GMT, on Sunday. Initial provisional results are expected about an hour after voting ends, with official results arriving overnight and into Monday. Campaigning concluded on Friday, followed by Saturday's customary day of reflection, during which campaigning is prohibited.

The shortage of affordable housing has led the campaign agenda, ahead of concerns about the broader cost of living and immigration. Housing has therefore been central both to the dispute that prompted the early election and to the issues voters have been asked to weigh during the campaign.

Sánchez has remained in office since 2018 and has established a prominent international profile through his opposition to Israel's actions in Gaza and his criticism of US President Donald Trump. At home, however, the housing crisis, corruption scandals and two fatal railway crashes have weakened his position.

Winning the largest number of parliamentary seats would not necessarily give Sánchez an easy route to another government. Even if PSOE finishes first, he is likely to face difficulty assembling a coalition of parties on the left. A government formed by Feijóo would depend on support from Vox, led by Santiago Abascal.

The PP and Vox have already governed together in four Spanish regions. Vox's involvement in a national government could have significant consequences for Spain and could further alter Europe's balance of power. Its policies include giving Spanish citizens priority for welfare and promoting the removal of foreigners deemed not to contribute to the economy.

Critics have drawn comparisons between aspects of Vox's ideology and the era of dictator Francisco Franco, a characterisation the party rejects. Alongside the immediate contest between the Socialists and the conservatives, the results will determine the parties' prospects for assembling enough parliamentary support to govern.