Education became a surprisingly important factor in the final month of Virginia’s election for governor, with Republican Gov.-elect Glenn Youngkin successfully hammering Democrat Terry McAuliffe for saying during a debate, “I don’t think parents should be telling schools what they should teach.”

McAuliffe made the statement when he explained why he opposed allowing parents to remove books they objected to from school libraries or curriculums, and the sentiment was found to be widely unpopular among Virginia voters, according to a statewide exit poll.

More than 8 in 10 voters in the network exit poll said parents should have at least “some” say in what their child’s school teaches, including 52 percent who said parents should have “a lot” of say. Just 13 percent said parents shouldn’t have much or any influence on what schools teach.

Those opinions tracked very closely with who voters supported for governor: Youngkin won 77 percent among the majority of voters who said parents should have “a lot” of say in what schools teach. McAuliffe won an identical 77 percent support among voters who said parents should have “some” say,” while the Democrat won 86 percent support among voters wanting less parental influence.

When asked in the same exit poll what issue was the most important facing the commonwealth, about a quarter named education. Youngkin won education-focused voters by a slender 6 percentage-point margin, but his message on parents’ rights helped him elevate the issue above the pandemic, on which McAuliffe had a stronger reputation. Pre-election polls by The Post and George Mason University’s Schar School showed the percentage of voters saying education was their top issue rose from 15 percent in September to 24 percent in late October.

Education as a campaign issue might strike a nerve more with parents. A Youngkin campaign ad featured a Fairfax County parent criticizing McAuliffe for vetoing a bill that would give parents the right to opt children out of sexually explicit reading assignments.

However, exit polling and other polling data do not find much of a split between how parents and non-parents voted in the election.

Network exit poll results found Youngkin won voters with children under 18 at home by a slim 52 percent to 48 percent over McAuliffe, similar to the 50 percent to 49 percent margin among non-parents. Those results represent big swings for both groups since the 2020 presidential election, but the swings were about the same. A year ago, exit polling found Biden won parents by 10 points and non-parents by 15 points.

Separately, the AP VoteCast voter survey found similar results with parents dividing 50 percent for Youngkin to 49 percent for McAuliffe and non-parents showing a similar 51 percent to 49 percent split. The survey was conducted in partnership with Fox News.

Two pre-election surveys detected a significant gap in voting between parents and others — a late-October Fox News poll conducted by phone found Youngkin leading by 14 points among parents compared with an eight-point advantage overall. And a text-message and online survey by the Republican firm Echelon Insights found Youngkin holding a 15-point advantage among parents, while non-parents were about evenly split between the candidates. A separate Washington Post-Schar School pre-election poll of voters reached by cellphones and landlines found public school parents splitting 48 percent apiece for each candidate.

The lack of a split between parents in either the exit poll or VoteCast surveys suggests that Youngkin’s parents-focused message did not turn out to be effective for that group. This may not be surprising after all, since issues of racism and discrimination that undergirded much of the debate over parental influence on schools resonate across the electorate, not just among parents.

Indeed, the exit poll found 51 percent of Virginia voters said monuments to Confederate leaders on government property should be left in place, and 82 percent of this group voted for Youngkin. The AP VoteCast survey found Youngkin won 90 percent of voters who said Virginia’s public school system is “focusing too much” on racism in the United States, while McAuliffe won 89 percent of those who said schools focus “too little” on racism and 68 percent of those who said the focus is “about right.”

Emily Guskin contributed to this report.