Protests against the teaching of LGBT relationships probably “strayed into harassing, alarming and distressing conduct”, a High Court judge said.
A trial is set to go ahead over whether protests can be held outside Anderton Park Primary School in Birmingham.
High Court judge Mr Justice Warby QC quashed an original injunction keeping protesters from the school and imposed a similar order until the trial.
He said some of the protesting had probably “gone beyond lawful limits”.
Parents had been gathering at the school gates over concerns children were “too young” to learn about LGBT relationships.
The initial temporary injunction was put in place to prevent protests from being held directly outside the school.
The school said the new injunction had been “widened to include any protests.”
The trial is scheduled to take place at the end of July and last two to three days.
The protests have been taking place for weeks, with parents saying they are concerned the lessons are not “age appropriate” and they contradict Islam.
The High Court injunction has been in place since 31 May, banning protests outside the school, which had to close early before half-term due to escalating action.
But protests have continued and, on Friday, parents held their first demonstration since it was brought in, with about 40 people gathering outside the exclusion zone on an area of grass about 100m from the school.
Protesters were also outside the hearing held at the Priory Law Courts in Birmingham on Monday.
Birmingham City Council lawyers earlier told the hearing the aim of the injunction was not to prevent people expressing their views about what children were being taught.
Instead, they said, it was to protect pupils, parents and staff from “unacceptable behaviour”.
The courts also heard how a police investigation was still ongoing into an incident in which people who tied ribbons to the gates in support of the school and members of the LGBT community had eggs thrown at them.
But John Randall QC, representing the protesters, said there had been no arrests.
The protests, he said, had been peaceful and it would require a “snowflake sensitivity” to regard them as terrifying or threatening demonstrations.
The judge said: “I find it likely the claimant [city council] will establish at trial some of the protesting has gone beyond lawful limits and strayed into harassing, alarming or distressing conduct, through its persistence, timing and context.”
On Sunday, it emerged Roger Godsiff, the MP for Hall Green, which covers Anderton Park school, will be spoken to by the Labour Party’s chief whip after he told campaigners protesting against the lessons “you’re right”.
Follow BBC West Midlands on Facebook, on Twitter, and sign up for local news updates direct to your phone.