Moments before Virginia lawmakers passed a bill Tuesday that allows parental control over sexually explicit material taught in schools, a senator read aloud a graphic rape scene on the floor of the Senate.

“How can we debate them if we don’t read them?” said Sen. Thomas A. Garrett Jr. (R-Buckingham), who read from the Toni Morrison novel “The Bluest Eye,” quoting words not typically spoken in the genteel chamber.

The critically acclaimed works of Morrison, a Nobel laureate, have been at the center of a heated debate about a bill that would make Virginia the first state in the nation to require K-to-12 teachers to notify parents of classroom materials with “sexually explicit content.” Parents could then “opt out” their children and request that the teacher provide an alternative assignment.

About half of Virginia school districts already follow this practice, but lawmakers who support the bill said it should be enshrined in state law. Opponents say the measure would remove discretion from local school boards and push Virginia down a slippery slope toward banning books.

The Senate on Tuesday passed the bill, 22 to 17, with the support of all Republicans and one Democrat, Lynwood W. Lewis Jr. (Accomack), who also voted for it in committee last week. Sen. Jeremy S. McPike (D-Prince William) was absent.

The bill now goes back to the House for a final vote before it reaches the desk of Gov. Terry McAuliffe (D), whose spokesman declined to say whether the governor would veto it. The House previously passed it unanimously in a block of uncontested bills, but subsequent attention could prompt some Democrats to vote differently.

The floor debate in the Senate veered into uncharted territory when Garrett, who is running for Congress, read from an excerpt that he later said was provided by Laura Murphy, the Fairfax County mother who prompted the bill, but he didn’t know which novel included the passage.

Sen. Stephen D. Newman (R-Lynchburg) interrupted Garrett and asked him to stop reading the scene because he said it was inappropriate for 12- and 13-year-old pages who were present in the chamber.

Senate Majority Leader Thomas K. Norment Jr. (R-James City) made a “humble request” for Garrett to cease, and he agreed.

A few minutes later, a visibly shaken Sen. John A. Cosgrove Jr. (R-Chesapeake) thanked Newman and Norment for “pleading for a stop to one of the worst — worst! — soliloquies we’ve heard on this house floor. I’m ashamed.”

In an interview later, Garrett said he would allow his 16-year-old daughter to read Morrison’s work but he wanted to be notified about it first. “I’d like veto power,” he said.

Several Democrats spoke against the bill, which calls for the state Board of Education to write specific guidelines for how teachers should proceed.

Sen. Janet D. Howell (D-Fairfax) said the bill undermines Virginia’s efforts to appear progressive in an effort to attract business that can rejuvenate the state economy.

“Toni Morrison has won the National Book Award, the Pulitzer Prize, and she’s the last American author to win the Nobel Prize for literature,” she said. “So let’s just make ourselves look ridiculous.”

But Sen. Charles “Bill” Carrico Sr. (R-Grayson) said the bill alone wouldn’t remove books from schools or deny students or parents the opportunity to read any book. He added that easily influenced children should not be exposed to books that include passages about rape, incest and bestiality, which he called “evil.”

“That evil act is just like a kitten,” he said. “It may be playful and harmless in the beginning, but you feed that evil, it grows and it grows. . . . It’s going to grow into a lion, and it’s going to eat you.”

In response, Sen. Mamie E. Locke (D-Hampton), who is chair of the Virginia Legislative Black Caucus, noted that the bill applies not only to English, but also science, physical education, social studies, art and art history.

“This bill is the kitten that is about to morph into a lion,” she said, “because next year we’re going to be seeing something else added on to this legislation that we’re going to be banning.”