Gerry Adams has failed in a court bid to overturn two historic convictions.
The former Sinn Fein president had challenged the legality of two convictions received in 1975 relating to escape bids while he was detained without trial at the Maze Prison during the early 1970s.
His lawyers argued at the Court of Appeal in Belfast that his imprisonment was unlawful because of flaws in the detention process.
The case hinged on a complex technicality that Mr Adams's internment was not legal because the order to hold him had not been considered by the then Secretary of State.
Mr Adams's legal team claimed his imprisonment was unlawful because an interim custody order was signed by a junior minister at the Northern Ireland Office and not the Secretary of State.
They contested that the 1972 Detention of Terrorists Order required senior level authorisation.
Three Court of Appeal judges rejected that argument on Wednesday.
"The Court of Appeal was satisfied that the ICO (Interim Custody Order) was valid having been made by the Minister on behalf of the Secretary of State," read the judgment.
"The Court was accordingly satisfied that the appellant's convictions are safe and dismissed the appeal."
The Louth TD was first detained in March 1972, but was released in June that year to take part in secret talks in London.
He was rearrested in July 1973 at a Belfast house and interned at the Maze Prison, also known as Long Kesh internment camp.
Mr Adams had challenged subsequent convictions handed down by two separate Diplock Court trials - cases tried by a single judge sitting without a jury - relating to two attempts to escape from internment.