Updated

Former Spanish Prime Minister Mariano Rajoy has made a strident defense of Spain's national unity as a witness at the trial of a dozen Catalan separatists.

Rajoy told Spain's Supreme Court on Wednesday that he had warned Catalonia's separatist leaders on several occasions leading up to their failed 2017 secession attempt that "the law, the national sovereignty and the Constitution are non-negotiable."

The ex-leader of Spain's conservatives was unable to stop the separatists from holding an unauthorized referendum and a subsequent declaration of independence in Oct. 2017. In response to the resulting institutional crisis, Rajoy fired the Catalan government and ordered a temporary takeover of the region by central authorities.

Rajoy retired from politics after his government lost a no-confidence vote in June.