A former IRA hunger striker and a brother-in-law of Martin McGuinness are to seek damages from the PSNI, after a court ruled that stop and search operations were unlawful.

On Thursday, senior judges considering the cases of Bernard Fox and Marvin Canning said sufficient safeguards to prevent abuse of the system were absent.

Canning, from Derry, claimed he had been questioned up to 100 times under the powers, which he said were incompatible with his right to privacy under European law.

The 55-year-old, who is related to the deputy First Minister through marriage, alleged officers were sometimes oppressive and confrontational.

He confirmed membership of the 32 County Sovereignty Movement, which he said is not an illegal organisation, but denied any involvement in terrorism.

Police rejected claims that powers under the act were arbitrarily used against Canning.

Fox, who took part in the 1981 IRA hunger strikes inside the Maze, brought a similar legal challenge alongside his companion, Christine McNulty.

Police searched a car the pair were travelling in near Camlough, Co Armagh in March 2011.

The Belfast man served more than 20 years behind bars for offences including possession of explosives before being released under the Good Friday Agreement. He denies any involvement with dissident republican activities.

Police said the power was used on the basis of threat, but lawyers were hoping to overturn a High Court decision that there had been no violation under the European Convention on Human Rights.

At the Court of Appeal, Lord Justice Girvan said there was no code of practice for stop and search operations.

“Pending the introduction of such a code the PSNI does not have a proper convention law compliant basis for exercising the section 21 power,” he ruled.

A further hearing will now be held to determine legal remedies in both cases.

Outside the court Fearghal Shiels of Madden and Finucane solicitors, representing Fox and Ms McNulty, welcomed the finding that the search had no proper legal basis.

Pledging further legal action over the alleged continued abuse by police of its powers, he added:

“We shall now pursue an action for damages on their behalf.”