A U.S. District Court judge ordered Greenville County Schools to pay more than $400,000 in a lawsuit over religious speech that's gone on more than six years.

The case was filed in 2013 over prayer during public elementary school graduations that were held in a chapel at North Greenville University, which is a Christian school. The lawsuit alleged "excessive entanglement with religion" and said the school district violated the First Amendment.

In a decision last year, Judge Bruce Hendricks ruled the prayer practice, use of religious music and use of the chapel violated the Establishment Cause and entitled plaintiffs to $1 in nominal damages for both violations. The court also ruled that although written school district policies were constitutional, district practices "endorsed certain religious activity," an order filed Tuesday states.

The order said students are not allowed to pray at official school events unless they choose to do so during time allowed for student remarks without school officials' knowledge, and they will not be allowed to ask the audience to participate in the prayer.

Just this March, Judge Hendricks amended her previous order to eliminate a portion that had banned religious music as part of official programs, saying it went beyond the scope of the lawsuit and that it would be up to "another lawsuit" to determine.

Hendricks also amended the order to require the district to have a written policy informing employees they will not be allowed to participate in student-led prayer at ceremonies where they are serving in an official capacity. Participating in student-led prayer includes "standing or bowing his or her head," the order said.

The plaintiff, American Humanist Association, requested $584,026.25 and on Tuesday was awarded a portion of that: $446,466 in attorney's fees and $9,776 in expenses, court filings show.

In a statement, Greenville County Schools spokesman Tim Waller said the school district argued throughout the case for students' rights to free speech, including speech that is religious.

"The School District has and will continue to remain committed to protecting students' rights to free speech, while remaining neutral to religion," he said.

The school district "will discuss the path forward with the insurance carrier covering the defense of this case," Waller said, but anticipates filing an appeal to the attorney fee award and the court's decision.

The American Humanist Association is a nonprofit based in Washington D.C. focused on advancing and preserving the separation of church and state, the lawsuit states.

Read more:Judge expands limits on student-led prayer at Greenville County School graduations

Read more:Humanists ask federal judge to stop prayer in Greenville County school graduations

Read more:Both sides find reasons to be pleased in Greenville school prayer ruling

Education reporter Ariel Gilreath contributed to this report.

Haley Walters covers public safety, crime and breaking news. Email her at hwalters@gannett.com and follow her on Twitter @_haleywalters