Ireland is setting up a judge-led inquiry into the Olympics ticketing scandal.

The move follows the detention of senior Olympic official Pat Hickey in a Rio prison after his arrest over the alleged illegal sale of tickets for the games.

Dublin's Sports Minister Shane Ross announced a judge will be appointed next week to head an independent inquiry into the affair.

Mr Ross had returned home early from Brazil to meet with Ireland's Attorney General about what could be done to get to the bottom of the controversy.

"We have agreed to establish a non-statutory inquiry to be carried out by a retired judge," he said.

"We believe that a judge led non-statutory inquiry is the most appropriate mechanism to establish the facts."

Mr Hickey, former president of the Olympic Council of Ireland (OCI), has been moved to a high security remand prison at Rio's Gericino Penitentiary Complex, known as Bangu Prison.

An application against his detention was denied by a judge, according to police in Rio.

Mr Hickey, 71, had been discharged from hospital in the city earlier and taken to a police station for questioning in connection with the investigation.

He was detained at a hotel in the Barra da Tijuca area and later taken to Samaritano hospital with chest pain before he underwent cardiac tests.

Mr Hickey has been formally accused under Brazilian law of ticket touting, running a cartel and illicit marketing.

This is a stage in the legal process that is not equivalent to being charged in British or Irish law but is a preliminary step in that direction. He has denied any wrongdoing.

The Olympic Council of Ireland has said it will fully co-operate with the Irish inquiry into the alleged illegal sale of tickets.

Two ticket agencies at the centre of the controversy have also pledged their co-operation and urged the anticipated probe in Dublin to make its findings as quickly as possible.

The OCI said: "The Olympic Council of Ireland confirms that it will co-operate fully with any state inquiry into its handling of ticketing arrangements for the Rio Olympics.

"The OCI will now also commission its own independent inquiry into the ticketing arrangements for Rio 2016. The previously announced internal inquiry by the OCI has been discontinued."

After his arrest Mr Hickey, from Dublin, stepped aside from his positions as the International Olympic Committee member in Ireland, president of the European Olympic Committees and vice president of the Association of National Olympic Committees.

The investigation centres on the sale of more than 800 tickets to the Games, including more than 20 which police said were intended for use by Ireland's Olympic officials.

Irishman Kevin Mallon, a director of THG Sports, which specialises in corporate and sports hospitality and is owned by Ipswich Town FC owner Marcus Evans, has been in custody in Brazil since August 5 over the affair.

Mr Mallon was arrested after police seized Olympic tickets in a Rio hotel, some of which were part of the Irish allocation and some for the opening and closing ceremonies and the football final.

The authorised ticket reseller (ATR) contracted by the OCI is Dublin-based PRO10 Sports Management.

The company said it had legitimate customers for its tickets and Mr Mallon was acting as a collection agent for them in Rio, meeting clients.

THG and PRO10 have denied any wrongdoing over ticket sales.

In a statement on Friday, THG said it wants the inquiry in Ireland to "be actioned expeditiously" and pledged its full co-operation "in the strong belief that it can demonstrate that the company has acted lawfully at all times".

"While THG respects the Brazilian police process, which clearly is different to that in the UK or Ireland, THG believes that a full and proper judicial assessment cannot be achieved without consideration of, and access to, all the THG compliance documentation which THG has followed in the provision of hospitality packages in Rio," the company said.

PRO10 also called for an inquiry to "be established speedily" and "report its conclusions in the shortest possible time".

"We have nothing to hide and are therefore anxious that the full facts are established and made public as soon as possible so that our good name can be exonerated," the firm said.