In a ruling on Friday, the High Court in London found Humberside Police's actions were a "disproportionate interference" with Mr Miller's right to freedom of expression.

The College of Policing's guidance defines a hate incident as "any non-crime incident which is perceived, by the victim or any other person, to be motivated by a hostility or prejudice against a person who is transgender or perceived to be transgender".

Mr Miller, who is from Lincolnshire, claims an officer told him that he had not committed a crime, but that his tweeting was being recorded as a "hate incident" .

Former police officer Harry Miller, 54, who founded the campaign group Fair Cop, said the police's actions had a "substantial chilling effect" on his right to free speech.

Humberside Police unlawfully interfered with a man's right to freedom of expression by turning up at his place of work over his allegedly "transphobic" tweets , the High Court has ruled.

Mr Miller's barrister Ian Wise QC said his client was "deeply concerned" about proposed reforms to the law on gender recognition and had used Twitter to "engage in debate about transgender issues"

But Mr Justice Julian Knowles rejected a wider challenge to the lawfulness of the College of Police guidance, ruling that it "serves legitimate purposes and is not disproportionate".

The judge said: "The claimants' tweets were lawful and there was not the slightest risk that he would commit a criminal offence by continuing to tweet.

"I find the combination of the police visiting the claimant's place of work, and their subsequent statements in relation to the possibility of prosecution, were a disproportionate interference with the claimant's right to freedom of expression because of their potential chilling effect."

At a hearing in November, Mr Miller's barrister Ian Wise QC said his client was "deeply concerned" about proposed reforms to the law on gender recognition and had used Twitter to "engage in debate about transgender issues".

He argued that Humberside Police, following the College of Policing's guidance, had sought to "dissuade him (Mr Miller) from expressing himself on such issues in the future", which he said was "contrary to his fundamental right to freedom of expression".

The judge said Mr Miller strongly denies being prejudiced against transgender people, and regards himself as taking part in the "ongoing debate" about reform of the Gender Recognition Act 2004, which the Government consulted on in 2018.

The judge added that the effect of the police turning up at Mr Miller's place of work "because of his political opinions must not be underestimated".

He continued: "To do so would be to undervalue a cardinal democratic freedom. In this country we have never had a Cheka, a Gestapo or a Stasi. We have never lived in an Orwellian society."

In his judgment, Mr Justice Julian Knowles stated: "I conclude that the police left the claimant with the clear belief that he was being warned by them to desist from posting further tweets on transgender matters even if they did not directly warn him in terms.

"In other words, I conclude that the police's actions led him, reasonably, to believe that he was being warned not to exercise his right to freedom of expression about transgender issues on pain of potential criminal prosecution."

Rejecting Mr Miller's challenge to the College of Police guidance itself, the judge said he was "satisfied that the aims and objectives of (the guidance) justify the limitation it imposes on freedom of speech".

Mr Justice Knowles said the guidance pursued "extremely important" aims, including "preventing, or taking steps to counter, hate crime and hate incidents" and preventing "the escalation of hate-based hostility from low-level non-criminal activity to criminal activity".

The judge has granted Mr Miller permission to appeal against his ruling on the lawfulness of the College of Police's guidance.

Ian Wise QC, representing Mr Miller, asked the court to grant a "leapfrog" certificate to allow the case to go straight to the Supreme Court.

Jonathan Auburn, for the College of Police, agreed that the case was suitable to go directly to the UK's highest court.

Mr Justice Knowles granted permission for the case to "leapfrog" to the Supreme Court, subject to that court's permission.

In a statement, Mr Miller's solicitor Paul Conrathe from Sinclairslaw said: "We welcome today's judgment, which is a vindication of Mr Miller's actions in posting tweets that were critical of transgender ideology and practice.

"It is a strong warning to local police forces not to interfere with people's free speech rights on matters of significant controversy.

"Today, the judge held that it is entirely acceptable to hold the view and communicate that a trans woman is not a woman. That view is not hateful, transphobic or unlawful."

Speaking outside the Royal Courts of Justice after the ruling, Mr Miller said: "Mr Justice Knowles was very clear - we have never had a Gestapo or a Stasi in Great Britain.

"Well, the actions of Humberside Police came way too close for comfort. This is a watershed moment for liberty: the police were wrong to visit my workplace, wrong to 'check my thinking'."

Holding a copy of George Orwell's Nineteen Eighty-Four, he added: "I'm going to continue tweeting, I'm going to continue campaigning and I'm going to continue standing with women in order to secure their sex-based rights.

"This judgment today has told us that we can do that and, if the police come knocking, say: 'Miller v Humberside Police, bugger off!"'

In a statement, Deputy Chief Constable Bernie O'Reilly, executive director at the College of Policing, said: "It is pleasing that today's judgment found that the College of Policing's guidance on the recording of non-crime hate incidents is both lawful and extremely important in protecting people.

"Policing's position is clear - we want everyone to feel able to express opinions as passionately as they wish without breaking the law."

He added: "Our guidance is about protecting people because of who they are and we know this is an area where people may be reluctant to report things to us because of the very personal nature of what they experience or perceive.

"In policing we don't always get things right and there will of course be some learning following today's judgment."