Albert Rivera, the leader of Spain's liberal Ciudadanos Party, soared to political celebrity naked — posing nude for a 2006 campaign ad in which he promised a refreshingly transparent political movement. "We don't care what clothes you wear," the ad declared. "We care about you."

With his resignation on Monday after a cataclysmic election result, Rivera appeared to exit politics much as he appeared in that buzzy ad: stripped down and with little to show supporters after his 13-year effort to build a new liberal-centrist movement except a strategically-placed hand to preserve his modesty. In Sunday's election, his party lost 47 of its 57 seats, shedding more than 2.5 million votes nationwide in the process.

But it is Brussels and the EU that could be left most exposed by the Spanish election results.

Prime Minister Pedro Sánchez and his center-left Spanish Socialist Workers Party (PSOE) still fell far short of a workable majority, leaving Spain — the fourth-largest of the EU27 countries — in continued political gridlock, and Sánchez himself in no position to claim much more of a role on the broader EU stage anytime soon.

Meanwhile the extremist, right-wing Vox party posted giant gains. It is now the country's third-largest political faction with 52 seats in the Congress of Deputies, showing the resilience of the Continent's nationalist, xenophobic political thread that continues to change and spread in unpredictable directions.

"Ciudadanos has always maintained that we want to get out of Spain's dichotomy of red and blue" — Luis Garicano, Ciudadanos delegation leader in the European Parliament

In Spain, the election exposed the dual miscalculations of Sánchez, who called the country's fourth national poll in four years hoping to break the deadlock that had prevented him from forming a government, and of Rivera, who had refused entreaties to enter into a partnership with the PSOE. But it also offers a cautionary tale for a new slate of EU leaders who are about to take office in an era of anti-establishment zeal among voters from España to Estonia.

The first lesson is the potential — and the limits — of trying to export French President Emmanuel Macron's "third way" approach. Macron, in his 2017 election victory and his continuing effort to upend the EU's status quo, has shown that it is possible to create a path for voters that is simultaneously anti-establishment and pro-EU.

But where France's presidential system allowed Macron to dispatch mainstream center-left and center-right opponents to set up a showdown with Marine Le Pen and her far-right National Front (now National Rally), Spain's parliamentary system limited Rivera's options. He faced a choice between joining forces with the PSOE or with the mainstay conservatives, the Popular Party (PP).

Rivera chose the PP, and in hindsight it was a big mistake.

Last spring, Sánchez and Macron were able to work together, bringing social democrats and liberals together to achieve their goals in the EU's deliberations over the bloc's top jobs.

But Rivera rejected calls, including from Luis Garicano, the leader of the Ciudadanos delegation in the European Parliament, to find a way to reach an accord with Sánchez that would have paved the way for the liberals to join a governing coalition and so avoid another election. Rivera ultimately did enter negotiations and offer Sánchez a deal this fall, but trust had long since evaporated between the two. It proved too little, too late.

In late June, as the EU leadership deliberations were underway and internal cracks were already appearing within the Ciudadanos leadership, Garicano, in an interview with El Mundo, said it was important for the party to stay focused on its main goal: "the necessity of a 'third' Spain" — meaning a third force in Spanish politics.

"Ciudadanos has always maintained that we want to get out of Spain's dichotomy of red and blue," Garicano said.

Had Rivera partnered with Sánchez in the spring, he could have claimed at least a supporting role among a new crop of Gen-X EU leaders, born in the 1970's, including Sánchez, Macron, Belgium's Charles Michel, and Luxembourg Prime Minister Xavier Bettel. From that perch, he and the party could have begun to build a track record in national government.

"T0 a certain extent it doesn't matter if you are center-left or center-right if you are part of a new generation of politicians, you have more in common, they can relate to each other," said a liberal political operative, who has advised leaders at the national and EU levels.

"If you draw a red line to the left and a red line to the right, there is nowhere to go" — Liberal political operative

"Rivera could have been one of those easily," the operative said, but instead balked at the risk of entering the governing coalition.

"If you draw a red line to the left and a red line to the right, there is nowhere to go," the operative said. "It was principles over politics, or principles over power and that was unwise, and I think this was widely recognized inside the party as well ... Garicano was not advocating for joining Sánchez, for Macronism or whatever. He was advocating for Sánchez because he was saying, 'Let's get into government. Let's show we can enact what we preach.'"

But as Ciudadanos grappled with Sunday's grim election result and the resignation of its charismatic leader, some inside the party on Monday preferred to blame Sánchez, saying he had never been willing to partner with the liberals who potentially posed a long-term threat.

And there is no question that Sánchez, too, will pay a price, along with his counterparts in Brussels who had been hoping he could emerge as a prominent and decisive leader of socialists in the European Council in the way that Macron and Dutch Prime Minister Mark Rutte set the tone for liberals, or as Angela Merkel has long done for conservatives. That now seems unlikely, with Madrid expected to continue focusing inward for the foreseeable future.

"We made mistakes, but I believe it is the result of Sánchez dividing society between left and fascists," said one Ciudadanos official, who spoke on condition of anonymity. "Everything to the right of Sánchez he considers fascist."

Such critics of Sánchez point to how he ignored the Vox leader, Santiago Abascal, during a televised electoral debate and instead tried to use Vox policies to attack Rivera and the PP leader, Pablo Casado, as all part of the same right-wing movement.

"Now he has [the] extreme-right skyrocketing; no clear majority; he lost 700,000 votes; and he has an ungovernable country. Great job," said the Ciudadanos official.

But the official said it was not the end of the centrist party because Ciudadanos had built a solid foundation. That includes control of regional governments in Andalucía, Madrid, Castilla y León and Murcia, the largest faction in the regional parliament in Catalonia and a strong delegation in the European Parliament.

"We will come back," the official said.

Announcing his resignation on Monday, Rivera offered a different lesson by paraphrasing a remark former U.S. President Barack Obama made about his successor Donald Trump.

"If to win, you have to divide people," Rivera said, "you are going to have an ungovernable country."