MADRID — Mariano Rajoy is involved in an increasingly nasty war of words with the one person whose support he thought he could count on.

With the country’s two main leftist parties — the Socialists and the far-left Podemos — largely unable to capitalize on a weakened Rajoy, the main rivalry in Spanish politics has become that between the Spanish prime minister's Popular Party and Albert Rivera’s Ciudadanos.

That's because Ciudadanos’ tough stance on Catalan separatism has led to a surge in support that is threatening the PP's position as the main force on the right of Spanish politics. Recent polls have Ciudadanos within striking distance, or sometimes even ahead, of Rajoy’s party — and the liberals came first in a regional election in Catalonia in December.

It wasn't always this way. Ciudadanos backed Rajoy becoming prime minister for a second term after a 10-month-long political deadlock in 2016 and its support has been vital for the few legislative proposals that Madrid’s minority government has been able to pass.

“There are too many commentators and a lack of rulers with the ability to make decisions” — Mariano Rajoy

That cooperation is now at stake. It’s not clear, for example, if the parliament will be able to approve the already-delayed budget for 2018.

Rajoy doesn’t have to call a general election until 2020, but the surge in support for Rivera, who dreams of an Emmanuel Macron-style assault on the ruling party, is clearly bothering the conservatives, and the hostilities have become more heated by the week.

“There are too many commentators and a lack of rulers with the ability to make decisions,” Rajoy said in Zaragoza last month, one of a series of party events at which the Spanish leader has tried to boost the morale of his troops and attack what he portrays as the ideological inconsistency of Ciudadanos.

The conservatives have also launched a series of initiatives aimed at countering the liberal momentum by burnishing the PP’s credentials as a party that is tough on crime and on Catalan nationalists.

They have announced, for example, a challenge to the primacy of the Catalan language over Spanish in Catalonia’s public schools, albeit without specifics. They've pushed forward a reform to increase the list of crimes punishable with life imprisonment, the toughest penalty in the Spanish penal code. And they’ve created a commission in the parliament’s upper chamber — where the PP holds an absolute majority of seats — to investigate Ciudadanos' finances.

Rivera has tried to avoid being outflanked by expressing support for the initiative on Catalan schools and performing a U-turn on his opposition to life imprisonment. He has also been hammering the PP on corruption (hundreds of PP officials have been caught up in corruption scandals) and Catalonia, as well as reminding Rajoy that he hasn't fulfilled the promises he made when he signed a cooperation agreement with Ciudadanos ahead of his investiture.

“The best way for Rajoy to calm his nervousness due to surveys and due to his failure in Catalonia is to comply with the 150 points of the investiture agreement that he signed with Ciudadanos,” Rivera told reporters earlier this month.

Rivera has also attacked the PP over a financial agreement reached last year with the ruling nationalists from the Basque Country, a region that enjoys fiscal autonomy. He says Rajoy's deal gives unfair privileges to an already wealthy region, but the prime minister has trouble fighting back as he needs the Basque nationalists’ support in parliament to pass the 2018 budget.

The rivalry between the two sides sometimes borders on the absurd. At a concert in Madrid last month, popular pop singer Marta Sánchez performed the Spanish national anthem, which doesn’t have any official words, adding a lyric of her own. A clip of Sánchez singing went viral, with much of the country’s left mocking her. Rajoy, however, took to Twitter (which he doesn't do very often) and congratulated her. “Very good initiative,” he said. Rivera rushed to do the same just 10 minutes later. “Brave and moving,” he cheered.

False dawn?

Ciudadanos has been here before. It enjoyed a surge in popularity in 2015 that didn’t translate into an electoral victory — it's the fourth biggest force in the parliament after the PP, the Socialists and Podemos. But its officials hope that this time its challenge to the dominance of the PP will be for real.

One reason for the optimism is the Catalan crisis, which has seen the party pick up support from the right without alienating its center-left voters. The party says two-thirds of its potential voters come from the PP, with one-third from the Socialists.

“Spain is more Jacobin than some thought,” said Toni Roldán, a Ciudadanos lawmaker. “We occupy the same political space as Macron: A big reformist, progressive center in favor of open societies.”

Conservatives point out that it's two years until the next planned election, which gives Rajoy plenty of time.

Another factor that's helped Rivera's party is the fall of Podemos, which has seen its support fall sharply in the polls. Fear of the far left has been one of the PP's strongest pitches since 2016.

“The fear of Podemos fed the PP. Its fall is key,” Roldán said, arguing that after the Catalan crisis the leftists, led by Pablo Iglesias — who advocated for a Scottish-style referendum on independence — “aren’t going to lift their heads.”

Conservatives point out that it's two years until the next planned election, which gives Rajoy plenty of time to turn things around on the back of strong economic growth.

“If they think we’re going to throw in the towel because they hit us with a couple of tweets, they really don’t know who we are,” said Rafael Hernando, the PP’s speaker in Congress.

Leader of the right

The PP has dominated right-of-center politics in Spain since the late 1980s, under the leadership of José María Aznar. Ciudadanos didn't exist back then. Formed in 2005 in Catalonia as a regional social democratic party that was against Catalan nationalism, it has shifted to the right, becoming a serious contender to the PP. According to a survey by the Center for Sociological Research, which used a scale of 1 to 10 to show political leanings (with 0 being extreme left and 10 being extreme right), Ciudadanos scored 6.7, with the PP on 8.1.

Rajoy will take some comfort from the electoral calendar. Barring a snap general election, the liberals will face their first serious test in local and regional elections that are due in 2019 — where the PP tends to do well among old, rural and uneducated voters.

Worryingly for Rajoy, however, a series of PP officials have defected to Ciudadanos in recent weeks. The trend, limited for the moment to a few dozen local officials, reminds some observers of the shift from France's Les Républicains to Macron’s La République en Marche.

Juan Rodríguez Teruel, a politics professor at the University of Valencia, said the defection of local officials is one of the greatest threats that the PP faces and could even lead Rajoy to call an early general election.

On top of that, a survey published last week has Ciudadanos replacing the PP as the second biggest party in Andalucía, the most populous region in the country, whose regional election will probably take place before most of the rest of the country in 2019 — meaning the liberals could get a boost ahead of the other regional ballots.

Rodríguez argued that Ciudadanos needs to make the most of the PP's problems — and fast.

“Ciudadanos has a window of opportunity," he added.