Mercer School in Princeton, W.Va. (Wade Payne/For The Washington Post)

A federal judge has thrown out a lawsuit challenging the constitutionality of teaching Bible classes in a West Virginia public school district because the district has suspended the classes for a year while it evaluates the program.

The “Bible in the Schools” program, offered as a weekly 30-minute class for elementary school students and a 45-minute class for middle schoolers, had been a part of the curriculum in Mercer County schools for decades and is widely popular with parents and children in the school district.

But earlier this year, two county residents with school-age children joined the Freedom From Religion Foundation — a national nonprofit group that works on issues concerning separation of church and state — to sue the district, saying the class violates the Establishment Clause of the Constitution and “advances and endorses one religion, improperly entangles public schools in religious affairs, and violates the personal consciences of nonreligious and non-Christian parents and students.” The Establishment Clause restricts government from prioritizing one religion over another.

The suit argued that Supreme Court rulings such as McCollum v. Board of Education in 1948 banned public schools from initiating or sponsoring religious activity. And, the plaintiffs said, the classes were similar to Sunday school lessons taught in churches and treated Bible stories as historical fact.

The suit quoted from one of the class lessons: “If all of the Israelites had chosen to follow the Ten Commandments, think of how safe and happy they would have been.” Another lesson asked students to imagine that humans and dinosaurs existed at the same time. It said: “So picture Adam being able to crawl up on the back of a dinosaur! He and Eve could have their own personal waterslide! Wouldn’t that be so wild!”

In May, the school district announced that it would suspend the Bible classes for the 2017-2018 academic year while it reviewed the content of the lessons and conducted a thorough review with input from teachers, community members and religious leaders.

Senior U.S. District Judge David A. Faber, of the Southern District of West Virginia, ruled Tuesday that although two of the plaintiffs had standing to bring the suit, there was no reason for the court to act because the school district was not offering the Bible classes this school year.

“The Bible in the Schools program of which plaintiffs’ complain is not currently offered nor will it be offered in the future,” Faber wrote in his opinion. “Furthermore, should a Bible in the Schools curriculum reemerge, the court has no information before it to determine the content of such a class.”

But Faber, who was nominated to his seat by President George H.W. Bush in 1991, reserved the right to act if the classes were reinstituted.

“If [Bible in the Schools] returns and it is clear the new . . . program violates constitutional law, this district is more than capable of granting a preliminary injunction,” he wrote.

Both sides in the case claimed victory.

The First Liberty Institute, a nonprofit law firm in Texas that represents the district and specializes in religious freedom ­cases, issued a statement saying: “Mercer County Schools is grateful to have this unfortunate lawsuit dismissed and remains committed to following the law as it provides diverse educational opportunities to its students. The court rightly rejected the notion that teaching students about the Bible is always unconstitutional.”

Patrick Elliott, co-counsel for the Freedom From Religion Foundation, said Friday that the lawsuit was unfairly dismissed but that the decision was a victory for the plaintiffs because the judge ruled that they had standing.

“The class is suspended, but if the district goes forward with reinstituting the class, the plaintiffs have standing and can go back to court and get a ruling,” Elliott said.

He added that the plaintiffs are considering an appeal of the ruling. They have until Dec. 14 to file.