London (AFP) - An activist with a London-based rights group was convicted of a terrorism offence on Monday for refusing to divulge the passwords for his phone and laptop computer to the police.

Muhammad Rabbani, international director at the Cage advocacy group, was stopped for questioning at London's Heathrow airport on November 20, 2016, and arrested after refusing to divulge the passwords.

Cage has campaigned since 2003 on behalf of people who have allegedly suffered abuses in the United States' fight against terrorism.

Rabbani told the court he wanted to protect a Qatari client.

"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," he said.

But the court dismissed Rabbani's arguments and handed him a 12-month conditional discharge, meaning no further action would be taken unless he commits a further offence.

Rabbani, 36, was also ordered to pay a fine of £620 ($835, 705 euros) and police have seized his phone and laptop.

Speaking outside court, Rabbani said the law amounted to a "digital strip search" and called for the legislation to be changed.

"I took the decision not to raise the details of an important torture case before my arrest and ultimately I have been convicted of protecting the confidentiality of my client," he said.

"If privacy and confidentiality are crimes, then the law stands condemned."

The head of London's counter-terrorism command, Dean Haydon, said the law under which Rabbani was convicted was crucial "to help keep the public safe".

"Schedule 7 of the Terrorism Act 2000 is a vital tool in the fight against terrorism and we are committed to ensuring the power is used appropriately and proportionately, as it was in this case," he said in a statement.

Schedule 7 was also used in 2013 against the partner of Glenn Greenwald, the US journalist behind the Edward Snowden intelligence leaks.

David Miranda, a Brazilian citizen, was held for nine hours at Heathrow airport while police questioned him and seized items including his phone and laptop.