Video report by ITV News Correspondent Stacey Foster
The ban, handed down at the High Court in Birmingham on Tuesday, includes an exclusion zone surrounding Anderton Park Primary School.
The legal bid had been opposed by protesters, along with an interim ban first granted at the same court in the summer.
In March, Anderton Park was forced to close early before half term to protect children.
Birmingham City Council was granted an order from outside the school’s gates in June, over safety fears about repeated large-scale demonstrations, often involving people with no direct connection to the school.
The council welcomed the ruling, saying they would continue to work with the school to "look at the best way to resolve any ongoing concerns".
After the ruling, Dr Tim O'Neill, the council's director of education and skills, said: "Birmingham is diverse and inclusive - these are its strengths - and we must all come together to ensure all children get the best education possible and are able to fully engage in all aspects of their life in this wonderful city and country.
"To this end, the city council will continue to work with the school to look at the best way to resolve any ongoing concerns.
"The city council will always stand up for the rights of all children, whoever they are and whatever family they are from."
The injunction was made against three individuals – the protest’s main organisers Shakeel Afsar and Amir Ahmed, and parent Rosina Afsar, as well as “persons unknown”.
Christian campaigner John Allman from Okehampton, Devon, had also opposed the legal bid, claiming it limited public protest.
Mr Justice Warby QC also awarded costs in favour of the council and directed that the three named defendants should be liable to 80% of those costs, which the court heard have yet to be calculated.
Headteacher Sarah Hewitt-Clarkson had previously described the demonstrations as “awful”, “toxic and nasty”, and has spoken of receiving threats as a result of the gatherings.
After the hearing, Mrs Hewitt-Clarkson said: "It has been awful - at the time - but today is a very good day.
"Today is the final bit of that. It's been awful.
"But my staff are unbelievable, my parents are unbelievable, the children of Anderton Park are incredible human beings.
"We're a big school and every single person is part of that strength."
Mr Afsar repeatedly claimed the weekly demonstrations, held just yards from classrooms and featuring megaphones and a sound-boosting PA system, were “peaceful”.
The self-styled businessman, who has no children himself at the school, claimed protests were only triggered because the headteacher had not properly consulted parents about relationships teaching.
He had argued education material used was not age appropriate, and further claimed the school was “over-emphasising a gay ethos”.
Mrs Hewitt-Clarkson rejected the claims, saying the material was appropriate and great care had been taken in how children were taught about different relationships.
She also told the judge, giving evidence at the injunction’s trial, that parents had had “numerous informal and formal chances to speak to us as a school” about any concerns.
But describing a private meeting she had with Mr Afsar in her office, she said: “He slammed his hand on my desk. He used the word ‘demand’… It was volatile, it was aggressive.
“I had never had a meeting like that before in 26 years of teaching.
“He set up a WhatsApp group that afternoon … trying to whip up a frenzy.”
Speaking after Mr Justice Warby, handed down the permanent injunction at the High Court in Birmingham, Mr Afsar said he was "bitterly disappointed" at the verdict.
At a press conference after the judgement, he doubled down on his stance and blamed the verdict on a lack of racial diversity among those who opposed the demonstrations.
"These young children are not being taught the status of law. "What they are being taught is that there is nothing wrong with this: that it is OK to be gay and it is OK to marry the same sex," he said.
"Well, like it or not, we do not accept this and will not accept this.
"Our religious convictions do not permit us the luxury of cowering to the council and the court's attempt to silence us."
He continued: "The judge is white, the council’s barrister is white, the council’s legal team is white, the teachers who gave evidence were white, the witnesses who gave evidence for the council were white.
“The councillors who misrepresented their voters were white, the police officers who presented witness statements for the council were white."
Despite his condemnation of the diversity lessons, he claimed to have "no issues" with the LGBT community and denied being homophobic.
He vowed the protests would continue.
Recounting claims made by speakers at the protests, including one that the school had a “paedophile agenda” and that staff were “teaching children how to masturbate”, the judge said: “None of this is true.”
He added: “None of the defendants have suggested it was true and the council has proved it is not true.”
Imposing the injunction, he said: “The court finds on the balance of probabilities the defendants bear responsibility for the most extreme manifestations (of the protest).”
Following the ruling, a Department for Education (DfE) spokesman said: "We've long said we want to end these protests and encourage positive dialogue, so we welcome the High Court's decision today.
"We continue to work with the school and parents to encourage positive and constructive engagement."
The injunction does not include an earlier ban on use of social media to abuse teaching staff.