Chief U.S. District Judge Fred Biery's order against the Medina Valley Independent School District also forbids students from using specific religious words including "prayer" and "amen."
The ruling was in response to a lawsuit filed by Christa and Danny Schultz. Their son is among those scheduled to participate in Saturday's graduation ceremony. The judge declared that the Schultz family and their son would "suffer irreparable harm" if anyone prayed at the ceremony.
Texas Attorney General Greg Abbott said the school district is in the process of appealing the ruling, and his office has agreed to file a brief in their support.
"Part of this goes to the very heart of the unraveling of moral values in this country," Texas Attorney General Greg Abbott told Fox News Radio, saying the judge wanted to turn school administrators into "speech police."
"I've never seen such a restriction on speech issued by a court or the government," Abbott told Fox News Radio. "It seems like a trampling of the First Amendment rather than protecting the First Amendment."
Judge Biery's ruling banned students and other speakers from using religious language in their speeches. Among the banned words or phrases are: "join in prayer," "bow their heads," "amen," and "prayer."
He also ordered the school district to remove the terms "invocation" and "benediction" from the graduation program.
"These terms shall be replaced with 'opening remarks' and 'closing remarks,'" the judge's order stated. His ruling also prohibits anyone from saying, "in [a deity's name] we pray."
Should a student violate the order, school district officials could find themselves in legal trouble. Judge Biery ordered that his ruling be "enforced by incarceration or other sanctions for contempt of Court if not obeyed by District official (sic) and their agents."
The Texas attorney general called the ruling unconstitutional and a blatant attack from those who do not believe in God -- "attempts by atheists and agnostics to use courts to eliminate from the public landscape any and all references to God whatsoever."
"This is the challenge we are dealing with here," he said. "(It's) an ongoing attempt to purge God from the public setting while at the same time demanding from the courts an increased yielding to all things atheist and agnostic."
Ayesa Khan, an attorney representing the student and his parents, told KABB-TV she was delighted in the judge's decision.
"It caused him a great deal of anxiety," she said, referring to her teenage client. "He has gone to meet with the principal to try and talk in a civilized way about long-standing problems, and the school district has continued to thumb its nose."
The judge did grant students permission to make the sign of the cross, wear religious garb or kneel to face Mecca. But that's not good enough for some students at the high school.
"It's just a big surprise that one kid can come in and change what's been a tradition since Medina Valley started," student Abigail Russell told KABB-TV.
Fellow student Alicia Jade Geurin agreed.
"At graduation, I would love to be able to speak from my heart," she told the TV station. "But in this situation I feel my freedom of speech and my First Amendment is being infringed upon if I can't say what I feel."
But the Rev. Barry Lynn, executive director of Americans United for Separation of Church and State, hailed the judge's decision.
"This is a high school graduation," he told Fox News Radio. "It is not a church service."
Lynn was critical of the attorney general's allegation that the ruling was an attempt to purge Christianity from the public square.
"Any attorney general worth his salt would know that's the issue and that this is not about promoting atheism," he said. "That's ludicrous."