The Supreme Court on Monday said separation of church and state does not prohibit public school employees from praying aloud on the job near students.
The case involved a high school football coach praying post-game at the 50-yard line, joined by his players.
Justice Neil Gorsuch authored the 6-3 opinion for the conservative majority.
"Both the Free Exercise and Free Speech Clauses of the First Amendment protect expressions like Mr. Kennedy's," Gorsuch wrote. "Nor does a proper understanding of the Amendment's Establishment Clause require the government to single out private religious speech for special disfavor. The Constitution and the best of our traditions counsel mutual respect and tolerance, not censorship and suppression, for religious and nonreligious views alike."
Justice Sonia Sotomayor dissented, joined by Justices Stephen Breyer and Elena Kagan.
In her dissent, Sotomayor introduced the case as being "about whether a public school must permit a school official to kneel, bow his head, and say a prayer at the center of a school event," and wrote, "The Constitution does not authorize, let alone require, public schools to embrace this conduct."
She said the free exercise clause serves as "a promise from our government" while the establishment clause serves as a "backstop that disables our government from breaking it" and "start[ing] us down the path to the past, when [the right to free exercise] was routinely abridged."
"It elevates one individual’s interest in personal religious exercise, in the exact time and place of that individual’s choosing, over society’s interest in protecting the separation between church and state, eroding the protections for religious liberty for all," she wrote.
Chief Justice John Roberts, Justices Clarence Thomas, Samuel Alito and Amy Coney Barrett joined the majority opinion in its entirety, and Justice Brett Kavanaugh joined for the most part.
The ruling in Kennedy v. Bremerton School District is a win for former high school football coach Joe Kennedy, who was suspended from his job in 2015 over post-game prayers on the 50-yard line that sometimes involved his players.
“This is just so awesome," Kennedy said in a statement Monday. "All I’ve ever wanted was to be back on the field with my guys. I am incredibly grateful to the Supreme Court, my fantastic legal team, and everyone who has supported us. I thank God for answering our prayers and sustaining my family through this long battle.”
Kennedy insisted the midfield prayers were brief, private individual acts of faith, while the school district argued that student participation breached constitutional prohibitions against the promotion of religion by government officials.
"It was my covenant between me and God that after every game, win or lose, I'm going to do it right there on the field of battle," Kennedy previously told ABC News of his ritual, which he said typically lasted less than a minute.
"This is a right for everybody. It doesn't matter if you're this religion or that religion or have no faith whatsoever," he said. "Everybody has the same rights in America."
The school district in Washington state responded to the ruling in a statement, saying, "In light of the court’s decision, we will work with our attorneys to make certain that the Bremerton School District remains a welcoming, inclusive environment for all students, their families and our staff.
"The Bremerton School District’s priorities have always been protecting the rights and safety of students while ensuring that they receive an exemplary education. That’s why, when we learned that a district employee was leading students in prayer, we followed the law and acted to protect the religious freedom of all students and their families," it said. "We look forward to moving past the distraction of this 7-year legal battle so that our school community can focus on what matters most: providing our children the best education possible."
Lower courts had sided with the school district. A Supreme Court reversal in favor of Kennedy could soon expand the ability of government employees nationwide to practice their faiths more openly while on the job, legal experts say.
The First Amendment protects free speech and free exercise of religion, but it also prohibits the establishment of religion by the government.
The Supreme Court has long said that public school-sponsored prayer violates the Establishment Clause, even if the prayer is voluntary.
At the same time, the court has ruled that free speech rights don't end at the schoolhouse gate and that religion need not be entirely expunged from public schools.
While Kennedy routinely prayed on the field after games for more than seven years, attracting varying levels of participation from students, it wasn't until 2015 that the school district informed the coach of constitutional concerns.
"They just said if anybody could see you anywhere here, it was over," Kennedy said.
The school district explained at the time in a statement that the prayers violated "constitutionally-required directives that he refrain from engaging in overt, public religious displays on the football field while on duty."
Some parents complained that the prayer sessions were applying inappropriate pressure on students to participate, even if unintended.
"The coach is a leader. The coach is a mentor. If he goes to the 50-yard line, he has a message he wants to deliver, and so the players would follow," said Bremerton parent Paul Peterson, whose son Aaron played for coach Kennedy in 2010.
"The harm is to those who are the minority students, the minority faiths, the students who have no faith," he said. "They are being pressured into doing something that they don't fundamentally agree with. That's what the First Amendment protects us from."
A federal appeals court called Kennedy's characterization of his prayers as brief, quiet and solitary as a "deceitful narrative," noting that they were clearly audible prayers surrounded by groups of students, amounting to unlawful religious speech as "a school official."
Kennedy's case has been cheered on by top Republicans, including former President Donald Trump, dozens of state and federal lawmakers, and star NFL quarterbacks, like Kirk Cousins and Nick Foles, who told the justices in a friend-of-the-court filing that the power of prayer promotes good sportsmanship.
The school district has had broad backing in court filings from other professional athletes, members of Congress, civil rights groups, teachers' unions, and local government groups, including the U.S. Conference of Mayors.
Kennedy currently lives in Florida but told the court that he would move back to Bremerton to return to coaching, if the justices ruled in his favor.
ABC News' Libby Cathey contributed to this report.