1 of 2
Daniel Ochoa de Olza, FILE, Associated Press
In this file photo dated Sunday, May 24, 2015, a nun casts her vote at a polling station in Madrid, Spain. Opinion polls indicate voters are fed up with Spain's economic downturn and the corruption scandals that have rocked the ruling Popular Party and the opposition Socialists, which have alternated in power.

MADRID — Reeling from punishment at the polls, Spain's ruling and main opposition parties prepared Tuesday for negotiations with anti-establishment newcomer groups in a bid to form regional power sharing alliances while Poland's governing party assessed how to reconnect with voters who ousted the president.

The elections held Sunday in the two countries thousands of kilometers (miles) apart exposed a common theme: Voters, many of them economically hurting or with friends or relatives who are, were turned off by politicians who snubbed their key concerns.

In Spain, Prime Minister Mariano Rajoy raised eyebrows during the campaign by suggesting few Spaniards were talking anymore about the unemployment rate of nearly 24 percent as he stressed Spain's return to economic growth.

His party won the most votes but lost the absolute control it enjoyed in eight of Spain's 13 autonomous regions that function much like U.S. states, and was defeated in its traditional Madrid powerbase.

An anti-eviction activist is on track to become Barcelona's next mayor as the new business-friendly Citizens Party and left-wing We Can Party emerged as king makers for regional and municipal governments across Spain after portraying Rajoy's Popular Party and the main opposition Socialist Party as out of touch.

Rajoy must call general elections by the end of the year, and Popular Party regional leader Juan Vicente Herrera said it was a mistake to trumpet an economic recovery that rings hollow for so many voters.

"There is a recovery and society needs hope, but this recovery is not noticed by many families," said Herrera, who won re-election to lead Spain's Castille and Leon region.

In Poland, President Bronislaw Komorowski lost re-election after a lackluster campaign in which he seemed out of touch with the problems of many Poles despite years of economic growth. Komorowski was backed by the ruling pro-market Civic Platform party, whose leaders are now struggling to see how they can avoid defeat in the more important parliamentary elections this fall.

At one point, Komorowski was asked by a young man how his sister can expect to get by and purchase a home when she earns 2,000 zlotys ($525) per month. Komorowski's reply: "Find another (job). Get a loan. Get work."

Since Sunday's balloting, party leaders have decried Komorowski's campaign as too passive, with some distancing themselves from the defeated president.

Poland's president has limited powers, but is the head of the armed forces, and can propose and veto legislation.

Komorowski's opponent was Andrzej Duda, a little-known right-wing member of the European Parliament. He won after an energetic campaign focusing heavily on low wages and poor job opportunities.

The defeats for the ruling parties in the two countries should serve as a wake-up call for European Union leaders to value political diversity and drum up support for the 28-nation bloc amid rising opposition from euro-skeptics questioning its value on economic and other fronts.

The Spanish and Polish votes drive home "the need to renew our being Europeans if we want to save the project of our founding fathers," said EU foreign policy chief Federica Mogherini.

Gera reported from Warsaw. Associated Press Writer Jorge Sainz contributed to this report from Madrid.