RICHMOND — A Senate committee in the Virginia General Assembly on Tuesday narrowly endorsed a measure to amend the state’s Bill of Rights to require all public places and schools to accommodate prayer or other religious activity and allow students to be dismissed from assignments or presentations that conflict with their religious beliefs.

The resolution — sponsored by Republican Sens. William M. Stanley, Jr. (Franklin) and Charles W. “Bill” Carrico (Grayson) — would guarantee public officials, students and others the right to conduct religious activities as long as they were not disruptive and no one was coerced to participate.

Stanley told the panel that the measure was intended to ensure that people of all religions would not be penalized for exercising their right to religious beliefs. To illustrate, he said that a Muslim high school student could ask to be excused from dissecting a fetal pig in biology class, because their religion views those animals as unclean, without affecting his or her grades.

“All religions are under attack,” Stanley said. “People of faith are under attack.”

But Claire Guthrie Gastanaga, executive director of the American Civil Liberties Union, said that the bill, if passed, would be an unconstitutional establishment of religion.

“It’s a backdoor way into school prayer,” Gastanaga said immediately after the Privileges and Elections Committee voted 8-6 to endorse the proposed amendment.

To amend the state constitution, the resolution would have to pass the General Assembly twice, with a general election for the House of Delegates between the two legislative sessions, and then receive approval from voters in a referendum.

The measure, Senate Joint Resolution 287, says the state “shall accommodate the right of any person to pray individually or corporately on public property so long as such prayer does not result in disturbance of the peace or disruption of a public meeting or assembly or other public business.”

The measure states that public officials and clergy members would be allowed to pray on public premises, including providing invocations at governmental meetings. The amendment would also ensure that students could express their beliefs about religion “free from discrimination based on the religious content of their work.”

Chris Freund, a spokesman for the Family Foundation of Virginia, said the organization has pushed for the measure because of bans and legal battles involving invocations at public meetings or whether high school football teams may pray in the locker room before a game.

“It’s kids not being able to sing a song at graduation because the word ‘God’ is in the song,” Freund said. “I think Virginians are tired of it.”

But critics suggested the bill would be used to enshrine Christianity in schools and public life. Sen. Janet D. Howell (D-Fairfax) said the measure appears intended to sneak creationism into the schoolhouse.

“It also makes it so a child can say, ‘I don’t want to study evolution because I don’t believe in it,’” Howell said.

Stanley disagreed.

“This is religious faith neutral. It’s all faiths. Zoroastrianism is protected. They’re protected as well as members of the Jewish faith, or the Christian faith, or the Muslim faith,” Stanley said.

He said that under his resolution, a student who has a literal belief in the Bible that God created the Earth in seven days would not be permitted to ignore Darwin’s theory of natural selection and evolution in class -- but he or she also would not be penalized for rejecting or disagreeing with those scientific teachings.

“They should still be able to recite Darwin’s theory,’’ Stanley said. He also said that language in the resolution about “licentiousness” would still allow the state to prohibit polygamy or other practices embraced by some religions.