The Rev. Robert Grant Jr. condemned same-sex marriage and abortion in a prayer before the Virginia House of Delegates.

A minister’s prayer condemning same-sex marriage and abortion caused some members of the Virginia House of Delegates to walk out Tuesday and the speaker of the House to slam her gavel and cut him off.

The Rev. Robert Grant Jr. of the Father’s Way Church in Warrenton, Va., delivered the opening prayer for the session; this duty goes to clergy members from a variety of faiths, and their prayers “are usually nonpolitical,” the Virginia Mercury reports. But Grant did not shy away from political issues.

He told House members that they risked God’s wrath for not following the Bible. He denounced abortion, saying, “All life is precious and worthy of a chance to be born.”

“And why are there so many abortion clinics near African-American communities?” he added. “This is planned urban genocide, and you can change this.”

He also condemned racial disparities in the criminal justice system, saying Blacks receive heavier sentences than whites for the same crimes.

Several minutes into his prayer, he turned to same-sex marriage. “Marriage is to join a biological male and a biological female in holy matrimony, not to provoke the Almighty God,” he said. “Without laws to protect traditional marriage, Virginia will be reduced to increased fatherless children and welfare victims and homelessness, a tax burden to us all.”

That’s when Speaker of the House Eileen Filler-Corn, a Democrat, banged her gavel and the delegates began the Pledge of Allegiance. Many Democrats had walked out during Grant’s prayer, and even some Republicans had retreated to the back of the chamber, The Washington Post reports.

While Grant was speaking, someone from the Democratic side of the room could be heard shouting, “Is this a prayer or a sermon?” Several members of both parties said they found the prayer’s content objectionable.

“It was totally disrespectful to all of us, all of us in this House,” said Del. Luke Torian, a Democrat who is also a pastor, told the Mercury.

“I don’t know if he was ill-instructed or didn’t realize what he was here to do,” added Del. Matt Fariss, a Republican. “This wasn’t the place or the time to do all of that. … This is a time we need to be working together and not being divisive.”

Grant remained defiant. “I think that the statehouse belongs to all the citizens. And all the citizens have a voice,” he told the Virginia paper. “If it’s my turn to have a voice, and I am a pastor, what do you expect from me? If you don’t want to hear what a pastor has to say, then don’t invite one.”

As Grant left, a man with him asked reporters if they knew that “sodomy” was once an offense punishable with death. He would not give his name.

Ministers usually submit the text of their prayers before delivering them, but this apparently did not happen in Grant’s case, the Mercury reports. He was invited by Del. Michael Webert, a Republican.

The prayer opened an action-filled day that saw the House approve an assault weapons ban and other gun control measures. With both the House and Senate under Democratic control since the last election, several progressive bills have won approval, including LGBTQ-inclusive antidiscrimination legislation that will soon head to Gov. Ralph Northam for his signature.