MADRID (Reuters) - Spain declared the withdrawal of its ambassador to Buenos Aires "permanent" on Tuesday in an escalation of its response to Argentine President Javier Milei's derogatory comments about the wife of Spanish Prime Minister Pedro Sanchez.

Spain had already recalled its envoy for consultations and demanded an apology after Milei insulted Begona Gomez at a rally in Madrid organised by the far-right Vox party on a visit in which he also snubbed usual protocols of meeting the king and prime minister.

Gomez has been the subject of a court investigation into accusations of influence peddling and business corruption by an activist group, though Madrid's prosecuting authority has appealed to drop the case due to lack of evidence.

"The ambassador will permanently stay in Madrid," Foreign Minister Jose Manuel Albares told reporters, using stronger diplomatic parlance than in previous days.

"We have no interest in nor desire for any escalation, but it's the government's obligation to defend the dignity and sovereignty of Spanish institutions, especially when the aggression occurs in the capital of Spain."

Albares said the embassy in Argentina would be headed by the charge d'affaires, adding that while ideological differences were debatable, "certain things aren't".

'SOCIALIST FOLLY'

Milei, a right-wing libertarian, promoted his book alongside Vox leader Santiago Abascal and appeared as the headline speaker at Sunday's rally for the far-right opposition.

Spain's socialist government considered itself especially insulted as it had allowed Milei's plane to land at a military base and given him special police protection for the 48-hour visit to the capital despite his avoidance of usual protocols.

In a telephone interview with broadcaster LN+, the Argentine president said the move was "an absurdity in diplomatic terms".

"What's happening is literally a folly typical of an arrogant Socialist, who personally took a comment that didn't contain any names as an allusion and nonsensically decided to go for a diplomatic escalation, so it's Pedro Sanchez's problem," he said.

"Does he believe he's the state? That's very totalitarian," he added, complaining that Sanchez had endorsed his rival in Argentina's election and not congratulated him for winning.

Milei had previously said it was Spain that should apologise to him after insults from officials including a suggestion that he was a drug user. But in the interview, he said he would not be so "stupid" as to respond in kind to Spain's diplomatic rebuke.

Sanchez has denied the accusation against his wife by the group Manos Limpias (Clean Hands) that she used her influence to secure sponsors for a degree course.

In his speech, Milei said global elites should beware the destructive ideas of socialism and the "kind of people" and "levels of abuse" it can generate before making an obvious allusion to Gomez's case when he spoke of "a corrupt wife".

(Reporting by Inti Landauro in Madrid and Gabriel Araujo in Sao Paulo; Writing by David Latona; Editing by Aislinn Laing and Andrew Cawthorne)

By Inti Landauro