By Rodrigo Viga Gaier

RIO DE JANEIRO (Reuters) - A Rio de Janeiro court on Monday ordered the release of the jailed former top European member of the International Olympic Committee (IOC), Patrick Hickey, pending further investigation into charges that he took part in a ring to illegally sell tickets.

After a request by lawyers for Hickey, who was also the head of the Olympic Council of Ireland, the court said the 71-year-old Irishman could leave the maximum security prison where he has been detained since his arrest on Aug. 10.

Hickey must surrender his passport within 24 hours of his release, the court said, and remain in Brazil until the investigation into the alleged ticket scheme is completed.

In a statement, Fernando Antonio de Almeida, the judge who issued the ruling, said "it is not likely that his release would create any obstacle or risk for public order, criminal instruction or, if necessary, the future application of any penal code."

After filing a writ of habeas corpus last week, seeking proof of any wrongdoing in order to justify his continued detention, Hickey's Brazilian law firm said it was hopeful for his release and that Hickey's age and history of health problems should weigh in his favor.

"Despite the accusations, there is no evidence that proves Hickey's involvement in such a scheme," said Helton Márcio Pinto, a partner at Arthur Lavigne Advogados Associados, the Rio law firm defending Hickey.

The scheme, according to Rio police, allegedly involved the funneling of Olympic tickets intended for use by the Irish committee and not authorized for resale to THG Sports, an international sports hospitality company.

Hickey temporarily stepped aside from his Olympic positions during the investigation, following his detention in his beach front hotel in Rio during the Olympic Games.

On Saturday, a court authorized the release of Kevin James Mallon, another Irishman and THG director who was arrested days before Hickey and was being held in the same prison. He left custody late on Saturday but is not allowed to leave Brazil, his lawyer told Reuters.

Police have said they have ample evidence of crimes committed by both men and other suspects in the case, but a full investigation and further court proceedings to determine their guilt or innocence could take months.

(Reporting by Rodrigo Viga Gaier; Writing by Paulo Prada; Editing by Daniel Flynn and Meredith Mazzilli)