Breaking with the custom of not expressing a view on other countries’ elections, Rajoy flew to Athens on Wednesday in a show of support for Samaras, whose conservative party is trailing in opinion polls after years of economic pain under an EU/IMF bailout.

Popular support for the Syriza party, which wants to cancel Greek debt-cutting efforts and renegotiate its obligations, has raised fears of a standoff with European partners.

Rajoy, like Samaras a center leader under pressure from the anti-establishment left, said economic reforms were “tough” and “difficult” decisions that governments generally do not like to make.

“But they have been necessary and essential and have produced results and most importantly have established solid bases for the future,” Rajoy said at a joint news conference with Samaras.

“I’m here to defend these policies. Above all, these are policies which guarantee the future.

“And the rest can say what they want, but I just want to say one thing: to promise things that are impossible makes no sense and generates an enormous amount of frustration.”

Spain’s leftist Podemos party is surging in polls.

In an indirect attack on Syriza’s plan to abandon Greece’s obligations under its bailout, Samaras said a country could not simply change its course once it has accepted terms in exchange for funds from its lenders.

“Things don’t work this way in Europe, and this is certainly not how the euro works,” Samaras said.

German Finance Minister Wolfgang Schaeuble reiterated on Wednesday that whoever wins the election in Greece will have to stick to a path of austerity.

Responding to the statements made by the two leaders, Syriza said Greece would soon have a government that would defend the country’s interests internationally.

“What unites Mr Rajoy and Mr. Samaras is fear of a democratic reversal by the forces of justice, democracy and dignity,” SYRIZA said.

Reporting by Renee Maltezou; Additional reporting by Paul Day in Madrid