(Adds market reaction, background)
By Ricardo Brito
BRASILIA, March 25 (Reuters) - A Brazilian appeals court judge on Monday ordered the release of former President Michel Temer from jail, following his arrest last week in connection with a corruption investigation.
Federal prosecutors have accused Temer, who was president from 2016 to 2018, of leading a "criminal organization" that had received or arranged for 1.8 billion reais ($472 million) in bribes through various kickback schemes.
He has denied any wrongdoing and his lawyers appealed for his release, arguing that he could be tried while free.
Judge Ivan Athié of the TRF-2 federal appeals court said in his ruling that the evidence provided by investigators did not justify the "preventive" jailing of Temer and seven other defendants, including former minister Wellington Moreira Franco.
"You have here old facts, involving possibly illegal acts, but no evidence of repeated criminality after 2016 or any other factor that justifies preventive imprisonment," wrote Athié.
The arrest of Temer on Thursday had added to a selloff in Brazilian financial markets last week, stirring concerns that the case could distract Congress from major economic reforms.
The Bovespa stock index erased losses on the news of Temer's release, trading in line with Friday's close. Brazil's currency firmed briefly to its strongest level of the day against the dollar before retreating to a 0.9 percent advance in the session. (Reporting by Ricardo Brito; Additional reporting by Eduardo Simões in Sao Paulo, Rodrigo Viga Gaier in Rio de Janeiro; Editing by Jeffrey Benkoe and Sandra Maler)