The UK Supreme Court has been hearing the latest attempt by Gerry Adams to overturn convictions for twice trying to escape from prison in the 1970s.
Judges were told they should be quashed as there was a legal flaw in the order for his internment without trial and that his detention was unlawful.
The court will deliver its ruling at a later date.
Last year, Mr Adams lost his case at the Court of Appeal in Belfast.
Mr Adams attempted to escape from the Maze Prison, also known as Long Kesh internment camp, on Christmas Eve 1973 and again in July 1974.
He was later sentenced to a total of four-and-a-half years.
Lawyers for Mr Adams, 71, argue that because the interim custody order (ICO) used to detain him was not authorised by the then-secretary of state for Northern Ireland, Willie Whitelaw, his detention was unlawful.
'Situation of civil emergency'
Opening Mr Adams' case at the Supreme Court in London on Tuesday, Sean Doran QC said his client's appeal had been "prompted by the obtaining of materials under the 30-year rule", under which Government papers are made public.
Mr Doran said those documents revealed that there had been "considerable debate within the Northern Ireland Office and the Home Office" about whether Mr Adams had actually been lawfully detained.
He added that a legal opinion requested by Northern Ireland prosecutors prior to Mr Adams' trial concluded that an ICO had to be personally considered by the secretary of state to be valid.
Mr McGleenan said that the power to make ICOs was designed "to deal with a situation of civil emergency".
He added: "It would have been impractical or even impossible for the secretary of state to give personal consideration to every request for the making of an ICO."In written submissions, Tony McGleenan QC, representing the Director of Public Prosecutions for Northern Ireland, argued that the minister of state who signed the ICO "had the power to do so".
A panel of five Supreme Court justices, led by the former Lord Chief Justice of Northern Ireland, Lord Kerr, and which includes the Lord Chief Justice of England and Wales, Lord Burnett, are expected to reserve their judgment.