(Reuters) - A federal judge ruled on Tuesday that a high school graduation in a San Antonio suburb may not include an opening and closing prayer or the words "invocation" or "benediction."

District Judge Fred Biery ruled that using those words would make it sound like Castroville's Medina Valley High School is "sponsoring a religion."

"We think that the district has been flouting the law for decades," said Ayesha Kahn, an attorney for Americans United for Separation of Church and State, which filed the lawsuit. "We're glad that the court is going to put an end to it."

No appeal of the ruling is planned, and the invocation and benediction will no longer take place, said Chris Martinez, assistant superintendent of the Medina Valley Independent School District.

"Our entire school system is set up on following the rules, and we are going to do that," Martinez told Reuters.

"But this is one parent's opinion of what we are doing. We don't believe we have done anything wrong."

Christa and Danny Schultz, who describe themselves as agnostics, sued the district, claiming that their son might not participate in the graduation set for Saturday if he were forced to participate in religious activities.

Biery ruled that students who are speaking at graduation can still talk about their faith, or cite a belief in God as the reason for their success, but they may not say "amen" or "God bless you," or have the audience rise and bow their heads.

There are 238 students set to graduate.

Martinez said the Pledge of Allegiance, which includes the words "under God," will go on as scheduled.

(Editing by Corrie MacLaggan and Jerry Norton)

Copyright 2011 Thomson Reuters. Click for Restrictions.

Correction: An earlier version of this story incorrectly identified the organization Americans United for Separation of Church and State as Americans United for Church and State.