An appeal court judge in Rio de Janeiro has ordered the release of Pat Hickey from prison.

Mr Hickey – who recently stepped aside as head of the Olympic Council of Ireland (OCI) – has been in prison since his arrest on August 17th over his alleged involvement in ticketing touting at the Olympic Games.

The judge granted Mr Hickey a writ of habeas corpus overturning a previous lower court ruling that blocked efforts by Mr Hickey’s lawyers to secure his release.

However, in allowing him to leave prison, Justice Fernando Antonio de Almeida ordered that Mr Hickey’s passport be retained to prevent him leaving Brazil while the investigation into him continues.

In his ruling the judge wrote that “in the case in question, none of the three crimes ascribed to have as their maximum applied penalty more than four years, therefore, evidently, it is not plausible to maintain him in prison like he finds himself”.

The judge said “it is not verified, in a concrete and objective manner, the necessity of cautionary custody” and that it was not shown that Mr Hickey’s release “would bring whatever obstacle to or rick to public order, criminal investigation or, if necessary, the future application of penal law”.

The ruling follows a decision on Saturday by the federal superior court of justice in Brasília to grant habeas corpus to Irishman Kevin Mallon, Dublin finance director of THG.

It was his arrest on August 5th, ahead of the opening ceremony in possession of 823 tickets for the Olympic Games, that sparked the controversy.

Mr Hickey and Mr Mallon were arrested by the Brazilian authorities investigating the alleged illegal sale of tickets allocated by the OCI to THG.

THG was not authorised to sell tickets or hospitality packages for the event within Brazil or abroad. Both men deny any wrongdoing.