The director of controversial advocacy group Cage has been convicted of an offence under the Terrorism Act for refusing to hand over the pin number for his mobile phone at Heathrow Airport.

Muhammad Rabbani, 36, was stopped under Schedule 7 on November 20 last year after returning home from a wedding in Doha.

He refused to give his pin or the password to his laptop, saying he had been stopped many times under the schedule before and had never been required to give these details.

Rabbani said he had highly confidential information on his device and that handing it to police would be a breach of his "personal and professional" privacy.

But on Monday he was convicted at Westminster Magistrates' Court of one count of wilfully obstructing a stop-and-search under Section 7 of the Terrorism Act.

Senior District Judge Emma Arbuthnot said: "I find he took a calculated risk and, as on certain earlier occasions, the police wouldn't take any further action.

"He took a calculated risk. At the time of the stop he was warned over and over he would be committing an offence if he didn't provide the information."

Muhammad Rabbani arrives at Westminster Magistrates' Court credit: DANIEL LEAL-OLIVAS/AFP/Getty

The court heard that Rabbani refused to tell officers what he did for a living or give out his pin saying "it won't help you in any way" and that it breached his privacy.

Pc Tariq Chaudhry, the officer who conducted the search, said: "I asked him questions about his occupation and he said he was a director of a company but wouldn't go any further - he kept saying 'You don't need to and it won't help you in any way'."

Pc Chaudhry said that Schedule 7 of the Terrorism Act gives officers their right to stop and search people "with or without suspicion".

Rabbani was repeatedly warned that he would be arrested if he failed to give his pin codes, but said he had never been asked to give this information during previous stop-and-searches.

In a prepared statement given at his second police interview in May this year, Rabbani said: "I considered that although the police were in law entitled to ask questions so that they could satisfy themselves I was not engaged in terrorist activity, that did not justify my in addition being required to expose all the sensitive contents of my phone to being copied and undoubtedly disseminated not just to police but to intelligence services and possibly elsewhere in the world - an unjustifiable, uncontrolled acquisition of material."

Supporters pray outside Westminster Magistrates' Court credit: Tess Delamare/PA

Giving evidence on Monday, he said that he had a large volume of documents relating to a Qatari client allegedly tortured in the US on his devices.

"It was a case involving the US against an individual who was allegedly tortured over the course of 12 or 13 years in US custody," he said.

"There were around 30,000 (documents) which I was especially uncomfortable handling and I felt an enormous responsibility to try and discharge the trust that was given to me."

But Judge Arbuthnot rejected his defence, finding he had taken a "calculated risk" in not providing the information despite being warned of the consequences by police.

He was handed a conditional discharge, ordered to pay £600 costs and £20 victim surcharge.

Cage describes itself as an "independent advocacy organisation working to empower communities impacted by the War on Terror".

The organisation sparked controversy when it emerged Isis executioner Mohammed Emwazi, dubbed "Jihadi John", had sought advice from Cage over alleged harassment by the British authorities before leaving for Syria in 2012.