A former defence minister of Ecuador has been released from house arrest on charges of allegedly authorising a secret deal to buy Argentine weapons.
Jose Gallardo had denied misusing public funds in 1995, in a $7.3m deal to purchase rifles and ammunition later found to be outdated and useless.
Ecuador was subject to a UN arms embargo at the time, because it was fighting a border war with Peru.
Mr Gallardo was freed on the orders of Quito's Deputy Mayor Andres Vallejo.
He was originally arrested on 24 February after the Supreme Court decided to revive the case, which had lain dormant since 2001.
He briefly regained his freedom by making a habeas corpus application, but was then detained again and placed under house arrest on Tuesday after a further Supreme Court ruling.
He was freed again late on Thursday after Mr Vallejo maintained that the Supreme Court had no authority to have Mr Gallardo detained, claiming that its current members had been appointed unconstitutionally.
The court's 31 judges were sacked on the orders of President Lucio Gutierrez in December and temporary replacements were drafted in, pending a decision on a permanent restructuring.
Opposition politicians allege that President Gutierrez is behind the attempts to arrest Mr Gallardo, because he had criticised the decision to overhaul the court.
Mr Gallardo has said through his lawyers that once he realised the arms were defective, he recovered the money from arms dealers.
Ecuador eventually made a $600,000 profit on the deal.
Argentine officials broke a weapons embargo to sell rifles and ammunition to Ecuador, even though the Buenos Aires government was trying to mediate in the conflict with Peru.
The border conflict only lasted for a month.
Former Argentine President Carlos Menem remains under investigation for allegedly smuggling the arms to Ecuador.
He spent five months under house arrest in 2001 and is due in court in two weeks' time for questioning over allegations he broke arms embargos by selling arms to Ecuador and to Croatia in the middle of the Balkan conflict.