This story has been updated.
Birmingham City Council made the application following several weeks of protests outside Anderton Park Primary School in the city.
Citing "increasing fears for the safety and well-being of the staff, children and parents", the council said it pursued legal action after the situation had become "too serious to tolerate".
The interim injunction covers the streets immediately surrounding the school and prevents protesters printing or distributing leaflets, inviting others to protest and encouraging people to congregate at the entrance.
According to the order published on the council's website, it also prohibits social media being used to make offensive or abusive comments about staff members.
Those protesting against LGBT teachings will have a chance to make their case to a judge on June 10.
Demonstrators have continued to gather outside the school in Dennis Road despite criticism from authorities including the council and police.
The head teacher announced the site would close for half term early last week over safety fears.
Leader of Birmingham City Council Councillor Ian Ward said: "I'm pleased that common sense has prevailed because children right across Birmingham should be free to attend school safely and without disruption.
"All our schools must be safe spaces and we will not tolerate the ongoing intimidation of parents, hard-working school staff and local residents.
"We'll continue to support the school and its staff and I would urge parents to take this opportunity to engage in constructive dialogue with the school about any concerns they may have."
Education secretary Damian Hinds has previously issued a fierce condemnation of the demonstrations, calling them "unacceptable".
Following the High Court injunction, Mr Hinds said: "I welcome the High Court's decision to put this injunction in place.
"It is not right to protest in front of schools - it is frightening to children and disrespectful to hard working teachers.
"This will allow children to return to school and parents to continue peaceful and constructive discussions with staff.
"I support and trust head teachers to make decisions in the interests of their pupils - parents should share their views and concerns, and schools should listen.
"However, what is taught and how is ultimately a decision for schools. Consultation does not mean parents have a veto on curriculum content.
"There is no reason why teaching children about the society that we live in and the different types of loving, healthy relationships that exist cannot be done in a way that respects everyone."
A spokesman for NAHT, the trade union serving school leaders, said: "We welcome this decision, as it brings much needed respite for the pupils and staff at Anderton Park.
"Credit is due to Birmingham City Council for supporting the school in seeking the exclusion order.
"The important thing now is for the Government to give clarity so that no more schools are faced with the kind of demonstrations that we have seen in Birmingham."
Stay up to date with the latest news stories from a Christian perspective. Sign up to our daily newsletter and receive more stories like this straight to your inbox every morning.