The government’s Prevent duty guidance to universities is unlawful and must be rewritten, judges have ruled after a successful judicial review argued that it violated freedom of speech.

The court of appeal found that Prevent guidelines on inviting controversial speakers were not balanced and accurate enough to inform universities of their competing obligations to ensure free speech while stopping people being drawn into terrorism.

It came after Dr Salman Butt, 33, a Muslim writer and publisher, brought a claim that the guidance went too far by containing a strong presumption against allowing events to go ahead where the risk of students becoming radicalised could not be eliminated.

He argued that the guidance was having a chilling effect on free speech and debate in universities by in effect barring speakers who may have interesting but controversial views. A once vibrant speaking circuit around university Islamic societies had been a;; but frozen by Prevent, he told the Guardian.

In their judgment handed down on Friday, Sir Terence Etherton, master of the rolls, Lady Justice Sharp and Lord Justice Irwin agreed, ruling that the “trenchant” language of the relevant sections of the guidance “is not only intended to frame the decision of [universities] on the topic in question, it is likely to do so”.

“We do not intend to attempt a redraft of paragraph 11, since that is a matter for the government,” the judges said. “We do, however, consider that a balanced guidance which better reflects what we perceive the secretary of state intended it to say … would be very easily achievable.”

Butt, a conservative Muslim and editor of the Islam21C website, brought his case after he was labelled an extremist speaker in a Downing Street press release marking the publication of the updated Prevent duty guidance.

Outlining the introduction of “specific policies to stop extremists radicalising students on campuses”, the release said the Home Office’s Extremism Analysis Unit had identified Butt as a speaker who was “on record as expressing views contrary to British values”.

Before the press release was published, Butt had had no contact with the police, the security services or any other government agency about his political and religious views, he said.

Butt’s appeal came after the high court rejected his claims, despite a judge essentially dismissing the Prevent guidance by ruling that universities were within their rights to ignore it in the interests of free speech. However, the appeal court upheld an earlier ruling dismissing Butt’s claim that collection and dissemination of information about his views had invaded his privacy and constituted unauthorised surveillance.

Butt now intends to appeal to the supreme court over that latter claim, and has lodged a separate libel claim against the government over its description of him as an extremist speaker. Lawyers for the Home Office have indicated that they intend to defend their claim on the basis of “honest opinion”.

Butt’s solicitor, Saimo Chahal QC, of Bindmans, called the ruling an important victory that vindicated claims that the Prevent guidance is too narrow, overprescriptive and restricted freedom of speech.

Since the publication of the guidance, university Islamic societies had become too scared to invite many external speakers, Butt said. Police and security services had not targeted him, despite his labelling as an extremist.

“I haven’t had any other problems ever. At borders and stuff, they just let me through,” he said. “I think if you just stand up and challenge something, they let you go. It’s the poor guys who just keep their heads down that keep getting hassled by Prevent. I think that’s what Prevent relies on; people just not knowing their rights.”

A Home Office spokeswoman said the court had agreed with it on the majority of the grounds in the case. However, she added: “We will consider the implications of the court’s judgment relating to a single paragraph of Prevent duty guidance for universities.”