(CNN) -- Honorary speakers at a Texas high school's commencement ceremonies will be allowed to invoke prayer at their graduation Saturday after a federal appeals court overturned a judge's ruling that would have banned it.

The ban, imposed Wednesday by U.S. District Court Judge Fred Biery, caught the attention of Gov. Rick Perry and state Attorney General Greg Abbott, who supported an emergency appeal filed by the Medina Valley Independent School District on Thursday.

"It should not be illegal for students to say a prayer at a graduation ceremony. Now, the federal court of appeals agrees," Abbott said in a statement Friday following the reversal.

The original lawsuit was filed last week by an agnostic family whose son attends Medina Valley High School in Castroville, about 30 miles west of San Antonio. The Schultz family said their son would suffer "irreparable harm" if anyone prayed at the graduation ceremony.

Biery ruled in favor of the Schultz family and ordered the school district to remove the words "invocation" and "benediction" from the program of ceremonies, replacing them with "opening remarks" and "closing remarks." The judge further ordered that students and other speakers to refrain from asking those in the audience to "stand," "join in prayer" or "bow their heads."

"They shall not otherwise deliver a message that would commonly be understood to be a prayer, nor use the word 'prayer,'" Biery wrote in his ruling.

Perry called the ruling "reprehensible."

"The First Amendment prohibits governments from interfering with Americans' rights to freely express their religious beliefs, and accordingly the U.S. Supreme Court has maintained that Congress may convene every day with a prayer," Perry said in a statement.

In addition to the school district's emergency appeal, the Liberty Institute, acting on behalf of class valedictorian Angela Hildenbrand, filed an emergency motion for intervention in the case.

Kelly Shackelford, president and CEO of the nonprofit organization that champions constitutional rights, issued a statement following the court's reversal, saying it "is a complete victory for religious freedom and for Angela."

Ayesha Khan, an attorney for the Schultz family, had argued that prayer at the school's graduation ceremonies were not student-initiated, but government-sponsored, and put pressure on audience members to participate against their beliefs.

"Those that do not participate get disapproved by the community," she told CNN.

In dissolving Biery's injunction, the Fifth Circuit Court of Appeals ruled that the Schultz family had not persuaded the three-judge panel "that the individual prayers or other remarks to be given by students at graduation are, in fact, school-sponsored."