Ecuador's National Court of Justice has that the seizure and arrest of former vice president Jorge Glas from inside Mexico's embassy in Quito was "illegal and arbitrary."
But the high court said in its Friday ruling that Glas would remain behind bars pending criminal investigation.
Mexico broke diplomatic relations with Ecuador following the arrest of Glas a week ago, carried out by security forces who stormed its embassy, a rare incursion on foreign diplomatic territory.
Lawyers for Glas are seeking his freedom after filing a writ to the court and seeking that his detention be declared illegal.
Glas, who served as vice president from 2013 to 2017, faces graft charges stemming from his time in office.
The raid came hours after Mexico granted a request by Glas for political asylum.
Mexico on Thursday appealed to the International Court of Justice in The Hague to suspend Ecuador from the United Nations unless it apologised for violating international law.
The high court ruling said the arrest was illegal since security forces had no warrant to enter the embassy. But the court added Glas would remain in a high security prison in the po rt of Guayaquil pending two other cases of corruption.
Several Latin American states, Spain, the European Union, United States and the UN chief have condemned the embassy intrusion as a violation of the 1961 Vienna Convention governing diplomatic relations.
'Persecution'
A legal consultant for Mexico's foreign ministry, Alejandro Celorio, lauded the court ruling, which he said "confirms" that Glas "faced political persecution."
Glas took refuge in the Mexican embassy last December before the justice system issued an arrest warrant for alleg ed embezzlement in the handling of funds for the reconstruction of villages devastated by an earthquake in 2016, an ongoing investigation.
Quito had requested authorisation to enter the embassy and arrest Glas, but Mexico's refusal and comments by its President, Andres Manuel Lopez Obrador, led to the expulsion of its ambassador and hours later to the armed raid.
Glas had already served some five years in prison on previous corruption charges. However, he was the subject of a fresh arrest warrant for allegedly diverting funds after the 2016 earthquake.
His friend and former boss Rafael Correa, Ecuador's president between 2007 and 2017, wrote on X Wednesday that Glas had made "a suicide attempt" following the embassy raid.
Correa lives in exile in Belgium to avoid serving an eight-year corruption sentence in Ecuador, and frequently posts on social media his views of his native country's affairs.
___
Source: TRT