The director of campaign group Cage refused to hand over the Pin to his mobile phone at Heathrow because it was "against his civil rights", a court has heard.

Muhammad Rabbani, 36, was arrested at the airport on November 20 last year under the Terrorism Act and later charged with obstructing or frustrating an examination under counter-terrorism stop-and-search powers.

On Monday, Westminster Magistrates 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.

He also refused to hand over the password to a MacBook, the court heard, and would only say that he was a "director of a company".

Rabbani had been returning from a wedding in Doha when he was stopped in the immigration hall at Terminal 4 by Police Constable Tariq Chaudhry.

Pc Chaudhry said: "He said he had arrived from Doha, I asked him what the reason for his trip was and he said he had attended a wedding there.

"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".

He refused to say whether he had had information on Rabbani prior to arrest, but prosecutor Tom Little said "this was not a random stop and search".

"The way he was talking gave me the strange suspicion that he was recording what I was saying and I asked him if he had a mobile phone or a recording device with him," said Pc Chaudhry.

In interview, Rabbani said he was familiar with Schedule 7 and had been stopped between 20 or 30 times and had never handed over his Pin codes.

He said: "By giving my mobile phone or passwords or similar all I am doing is violating my own privacy which I don't think (the act) covers."

Rabbani said that previous officers using the stop-and-search powers had "exercised judgment" and not asked him for his Pin codes or passwords.

He added: "All I'm saying is, let's be reasonable, you don't need to make a big fuss if you don't have to."

Pc Chaudhry said: "No-one has refused to hand over a Pin code in the past, it was the first time anyone I had ever come across when (they've) point blank refused."

The officer admitted that he had not informed Rabbani that he did not have to hand over information related to his role as director of a company that he had been given in confidence.

The defendant repeated his claim that handing over his Pin code and password would breach his privacy to Pc Christopher Denley when he went to assist his colleague.

Rabbani, from Bethnal Green in east London, denies a single charge under Schedule 7 of the Terrorism Act.

The charge states that "on 20 November 2016, at Heathrow Airport, he did wilfully obstruct, or sought to frustrate, an examination or search under Schedule 7 of the Terrorism Act 2000, contrary to paragraph 18(1)(c) of that Schedule".

Dozens of his supporters and members of Cage filled the public gallery.

His solicitor, Gareth Peirce, said at a previous hearing that the issues in the case would include "the legality of the stop, the legality of the examination and the legality of the request for Mr Rabbani that he provide the Pin number for his phone".

The trial, which is listed for one day, continues.