The former Sinn Féin leader Gerry Adams was interned illegally at the height of Northern Ireland’s Troubles because the wrong minister approved his detention order, the supreme court in London has been told.

In an attempt to overturn two criminal convictions for escaping from the Maze prison in 1973 and 1974, lawyers for the 71-year-old are challenging the way he was originally held under emergency legislation.

Adams, who has always denied being a member of the IRA, was taken into custody under article 4 of the Detention of Terrorists (Northern Ireland) Order 1972, which covered anyone whom the secretary of state for Northern Ireland “suspected of having been concerned in the commission or attempted commission of any act of terrorism”.

The regulations required that Northern Ireland secretary be involved personally in making any such decision.

Documents released to the public records office under the 30 years rule have since revealed that the government knew there had been a procedural irregularity in relation to the detention of Adams and other republican detainees who had tried to escape with him from the heavily guarded internment camp.

A note for the record found in the files, dated 17 July 1974, related a meeting held by the then Labour prime minister, Harold Wilson, called to consider “an urgent problem which the attorney general had brought to his attention”.

The note explained that “following a recent attempt to escape by four prisoners [a reference to Adams and others] from the Maze, an examination of the papers concerning those prisoners revealed that applications for interim custody orders concerning three of them had not been examined personally by the previous secretary of state for Northern Ireland during the Conservative administration.

“It now appeared that the [previous] Conservative administration had left both tasks to junior ministers in the Northern Ireland office and, according to [the attorney general’s] information, there might be as many as 200 persons unlawfully detained in Northern Ireland.” Adams’ order was signed by a minister of state.

Adams, who now sits as a Sinn Féin TD for Louth in the Irish Dail, was not present at the supreme court hearing in London which was heard by five justices including the lord chief justice of England and Wales, Lord Burnett. Lord Kerr, a former lord chief justice of Northern Ireland, presided.

Adams was first interned in March 1972 and was released in June that year to take part in secret talks with the Conservative government in London. More than 1,900 suspects were interned in the early years of the Troubles as violence spiralled out of control. Those held were overwhelmingly nationalists or republicans; not all were members of paramilitary organisations.

Adams was rearrested in July 1973 in Belfast and taken to the Maze, also known as Long Kesh idetention centre. On Christmas Eve 1973 he was one of four detainees caught attempting to break out. A hole had been cut in a perimeter fence and all four men were already out of the prison.

His second escape attempt, in July 1974, was a more elaborate scheme involving kidnapping a man who had a striking resemblance to him from a bus stop in west Belfast. The man was taken to a house where his hair was dyed and he was given a false beard, the lower courts in Belfast were told.

His double was driven to the Maze where the plan was that he would be swapped for Adams in a visiting hut. Prison staff had been alerted, however, and Adams was arrested in the car park of the jail. He was later sentenced to 18 months in jail for the first escape attempt and an additional three years for the second attempt, after two separate trials before single judges sitting without a jury.

Presenting Adams’ appeal at the supreme court, Sean Doran QC said: “Everything goes back to the original order … We would ask the court to rule that those convictions are now unsafe.”

The supreme court has been asked to decide whether it was parliament’s intention that only the secretary of state for Northern Ireland should have the power to make an interim custody order.

The director of public prosecutions for Northern Ireland, who is the respondent in the case, has successfully argued in the Northern Ireland courts that the Carltona principle – based on a 1943 test case – allows that “where parliament specifies that a decision is to be taken by a specified minister, generally that decision may be taken by an appropriate person on behalf of the minister.”

The hearing continues. Judgment is expected to be reserved.