Spaniards are voting in a snap general election that could, for the first time since the death of Gen Francisco Franco in 1975, put a far-right party in government. Because nothing says "return to democracy" like a coalition with the ideological descendants of the guy who ran the place before democracy.

The election wasn't due until summer next year, but socialist prime minister Pedro Sánchez called it in October after three rightwing and far-right parties - the conservative People's party (PP), the far-right Vox, and the rightwing Catalan separatist Junts - voted down his emergency housing legislation. Nothing unites the right like blocking help for renters.

Public anger over soaring rents exploded in September after the eviction of María del Carmen Abascal, an 87-year-old woman removed from her Madrid home because she couldn't afford the 230% rent increase demanded by the investment fund that had bought her apartment. The fund, presumably, is doing fine.

Faced with nationwide protests, Sánchez's minority coalition government proposed a package including a ban on evictions until 2030 and regulation of temporary lettings and lettings by room. The PP, Vox, and Junts torpedoed it, prompting Sánchez - an inveterate risk-taker whose penchant for unpredictable moves has fuelled his political survival - to gamble on an early election, calculating that the block might backfire on his opponents.

Polls suggest it might not. While Sánchez's Spanish Socialist Workers' party (PSOE) has narrowed the gap with the PP to fewer than three percentage points, the right looks likely to form the next government. Survey after survey predicts the PP will finish first but fall short of a majority, leaving it dependent on Vox. Together they are forecast to secure a joint majority well above the 176 seats required in Spain's 350-seat congress of deputies. Even if the PSOE surges and comes first, parliamentary arithmetic suggests it would struggle to cobble together another coalition with the leftwing Broad Front alliance and regional nationalist parties.

Sánchez said he had "a good feeling" as he voted on Sunday morning, adding he was seeing "a historic mobilisation" of voters. PP leader Alberto Núñez Feijóo said the election would "shape the destiny and direction of Spain not just for the next four years but for the next decade." No pressure, voters.

Choosing housing as a key battleground allowed Sánchez to shift focus from corruption allegations facing his inner circle and from his government's much-criticised handling of the crisis in Spain's north African territory of Ceuta, sparked when about 80,000 people crossed in from neighbouring Morocco in 48 hours. But some of the government's campaign energy was sapped at the end of October when 69 people were killed in Spain's second deadly rail crash in just nine months. The PP and Vox have used the crashes to accuse the government of failing in its basic duty to keep Spaniards safe - because nothing says "safe" like a party whose coalition partner wants to prosecute the prime minister for treason.

More broadly, the PP and Vox are using the poll as a referendum on what they disdainfully call "sanchismo," arguing the prime minister's style is cynical, corrupt, opportunistic, and self-serving. "Spain deserves a decent prime minister and [Sánchez] isn't one," Feijóo said during a head-to-head debate last week. Sánchez countered that while he had made errors, Spain was in a better state than when he took office in 2018. "My government hasn't been perfect; I've made mistakes," he said. "But I'm also fully aware that we have always governed in the right direction."

Sánchez has sought to depict the election as a stark choice between progressive and reactionary forces, typified by the PP's putative alliance with Vox. "You must decide whether you want our country to move backwards or continue moving forwards," he told Spaniards when announcing the vote. In recent days, his government proposed a new tax on fortunes over €100m (£84m) to fund childcare, housing, and public services - a move that will surely be popular with the approximately zero people who have €100m fortunes.

Despite the polls, Sánchez remains confident. "I can't conceive of us losing," he told Cadena Ser radio on Friday, adding: "When progressive Spain gets going, it's unstoppable." The PP, meanwhile, promises to lower taxes, build 1m homes, and "restore the country's ambition and self-esteem." Vox's manifesto includes plans to prosecute Sánchez and his government "for treason and crimes against the security of the state" over the Ceuta mass crossing, plus deregulation, "remigration," and giving Spanish-born people priority over those born abroad for housing and public services. Because nothing solves a housing crisis like blaming foreigners.

Although former PP leader Pablo Casado famously repudiated Vox, accusing it of practising politics based on "fear, anger, resentment and revenge," the PP has repeatedly entered regional coalitions with Vox and now runs four of Spain's autonomous regions with the party. In recent days, both parties have questioned the fairness and transparency of the election, making baseless claims that the government may rig postal votes. Vox leader Santiago Abascal has also suggested, without evidence, that Sánchez is working to undermine democracy and change the country's demographic makeup. Because if you're going to lose, at least lose with a conspiracy theory.