MADRID – Spain's political landscape has changed dramatically since 2011, when voters ousted the Socialist Party and gave a landslide victory to the right-of-center Popular Party.
The rise of two influential new parties to challenge the two longstanding traditional parties has injected tension and suspense into Sunday's ballot, when voters will give their verdict on who they believe will do the best job of ending high unemployment and a string of corruption scandals in the European Union's fifth-largest economy.
Here's a look at what's at stake in the national election:
Prime Minister Mariano Rajoy's Popular Party is seeking a second consecutive four-year term. It currently holds a majority of 186 seats in the 350-seat lower house of Parliament. The Socialists hold 110 seats. Newcomer parties Ciudadanos and Podemos don't have any because it's their first time fielding national candidates.
Spain's 36.5 million registered voters will elect representatives to the lower house and to the Senate, a separate chamber without less legislative power.
Polling stations open at 0800 GMT and close at 1900 GMT. Exit polls are expected within minutes of polls closing.
Partial official results will be released periodically throughout the evening, with most results expected by 2300 GMT. Complete results, including postal votes, are expected two days later.
Three issues have dominated Spanish politics over the past four years: the nation's economic crisis, corruption and a separatist drive in the northeastern region of Catalonia bordering France. Rajoy has boasted about his handling of the first, done his best to skirt the second and has vowed to halt the independence push.
His administration's biggest success has been in pulling Spain back from an economic abyss in 2012 and returning the economy to steady growth, but the jobless rate still stands at 21 percent.
Unemployment began climbing during the global financial crisis of 2008 and hit 27 percent in 2013. Rajoy's party adopted unpopular austerity measures and labor and financial reforms credited with creating jobs. Although Spain's economy is now one of the fastest-growing in the 28-nation European Union, its unemployment rate is the second-highest in the EU after Greece.
Rajoy's administration has been hurt by his U-turn on a promise not to raise taxes and the austerity measures that cut national health care and public education. Many Spaniards are also angry about what they perceive as the impunity of politicians and business leaders amid incessant corruption cases.
The question of independence for economically and politically powerful Catalonia has divided that region and soured political ties with the rest of Spain. Rajoy vows to quash what is seen as the biggest threat to Spanish unity in recent decades. Other parties favor negotiations to devolve more power to Catalonia.
Rajoy, a tall, gray-bearded 60-year-old, studied law and became the country's youngest property registrar at the age of 24. He champions conservative social policies, siding with the Roman Catholic Church against abortion.
Pedro Sanchez, a 43-year-old former university economics professor, was unknown to most Spaniards until he was elected leader of the main opposition Socialist party last year. The former basketball player has been a Madrid city councilor and a member of Parliament.
Ciudadanos has the eloquent and media savvy Albert Rivera as its leader. Rivera, at 36 the youngest candidate, was a national debating champion. He began campaigning only a year ago but his moderate, business-friendly policies plus a pledge to crack down on corruption have attracted voters.
Political science professor Pablo Iglesias and his radical left Podemos party want to break the mold of Spanish politics. The ponytailed 37-year-old, who prefers jeans to suits, comes from a blue-collar background and is an ally of Greece's leftist Prime Minister Alexis Tsipras. Podemos was born from massive Madrid street protests in 2011 that drew mainly young Spaniards weary of business and political corruption.
The country's drab two-week campaign got a jolt on Wednesday when a 17-year-old high school student punched the primce minister in the face during a campaign appearance in Rajoy's home town. The boy's lawyer said the attack wasn't politically motivated, but didn't give a reason for it.
Rajoy also raised questions about his future as the Popular Party leader by including his deputy, 44-year-old Soraya Saenz de Santamaria, on campaign posters that would traditionally be reserved for him. She also substituted for Rajoy in a TV debate with Iglesias, Rivera and Sanchez — spurring speculation that she could replace Rajoy if he is unable to form a government after the election.
Opinion polls have been unanimous in suggesting that no single party will get a parliamentary majority, and the outcome is extremely unpredictable with as many as 40 percent of voters undecided.
Most polls show the Popular Party leading, while Ciudadanos, Podemos and the fight it out for second place.
The Popular Party and the Socialists are expected to benefit from Spain's system which gives a higher proportion of legislative seats to rural areas with fewer voters.
THE DAY AFTER
An inconclusive election result — one that gives no single party a majority in Parliament — could open the door to a "coalition of losers" taking power, as recently happened in neighboring Portugal.
Under the Constitution, King Felipe VI will invite a party leader to form a government. If the second- and third-placed parties join together and have more parliamentary votes than the winner, the monarch could nominate them instead of the victor.
Analysts expect a tense period of postelection bargaining. The nominated party leader must win a vote of confidence in Parliament to take office.
If the issue is not resolved after two months, a new election is called.
Hatton contributed from Lisbon, Portugal.