A statue of Confederate general Robert E. Lee sits in Emancipation Park, Tuesday, Aug. 15, 2017, in Charlottesville, Va. The deadly rally by white nationalists in Charlottesville, over the weekend is accelerating the removal of Confederate statues in cities across the nation. (AP Photo/Julia Rendlema)

Virginia Gov. Terry McAuliffe said Wednesday that he wants Confederate statues across the state relocated from public spaces to museums, saying they had become a “barrier to progress, inclusion and equality in Virginia.”

McAuliffe (D) urged municipalities and the state legislature, which he said had the legal authority to do so, to heed his words.

It was a reversal for McAuliffe, who has said he did not support taking down monuments and the decision should be up to local communities.

The governor made the announcement after attending the morning memorial service for Heather Heyer, the 32-year-old woman who died Saturday after a car plowed into a crowd of counterprotesters at a white nationalist rally in Charlottesville.

The debate over Confederate monuments in Virginia roiled the race to replace McAuliffe, who is restricted by law from seeking a second term. Lt. Gov. Ralph Northam, the Democrat hoping to succeed his boss, called for relocating statues to museums earlier in the day.

Bob Brown/Richmond Times-Dispatch/AP

“I believe these statues should be taken down and moved into museums. As governor, I am going to be a vocal advocate for that approach and work with localities on this issue,” Northam said in a statement. “We should also do more to elevate the parts of our history that have all too often been underrepresented.”

It’s a firmer stance for Northam, who previously treated debates over Confederate memorials as a local issue.

Virginia Attorney General Mark R. Herring, a Democrat who is running for reelection, said he agreed with McAuliffe and Northam that the statues should be removed from public spaces.

Justin Fairfax, a Democrat running for lieutenant governor who would be the first African American elected statewide since Gov. L. Douglas Wilder, did not urge relocating statues to museums, instead saying localities should be “empowered to decide how to deal with these divisive and harmful symbols.”

Meanwhile, GOP nominees for lieutenant governor and attorney general blasted the idea of moving the statues as erasing history. Republican gubernatorial nominee Ed Gillespie urged a nuanced approach to the statues that emphasizes education, not glorification.

In an essay on his campaign website, Gillespie said he opposes removing Confederate statues but understands the issue is freighted with emotion. “I know that for many of my fellow Virginians, statues of Confederate soldiers are offensive and should come down,” he wrote. “I know that for many others, they are a reminder of heritage and we cannot erase history by taking them down.”

Gillespie barely won the GOP nomination in June against Corey A. Stewart, who made defending the state’s Confederate heritage his signature issue.

“There is a balance that can be struck here, one that recognizes the outsized role Virginia has played in our history, while acknowledging that we have not always been on its right side,” Gillespie wrote. “Rather than glorifying their objects, the statues should be instructional.”

On Wednesday, Richmond Mayor Levar Stoney said he wants to see the removal of four statues of Confederate figures that line Monument Avenue, a prominent boulevard through the heart of the former capital of the Confederacy. It was a sharp reversal for Stoney, who less than two months ago said he wanted to maintain the statues but add historical context and perhaps other monuments as a counterbalance. Stoney formed a commission to study ways to achieve those goals.

But Charlottesville was apparently a turning point for Stoney.

“While we had hoped to use this process to educate Virginians about the history behind these monuments, the events of the last week may have fundamentally changed our ability to do so by revealing their power to serve as a rallying point for division and intolerance and violence,” he wrote in a statement.

In response to Northam’s proposal to relocate Confederate statues, State Sen. Jill Holtzman Vogel (R-Fauquier), who is running for lieutenant governor, tweeted: “This makes me very sad. We should teach history not erase it.”

John Adams, Republican candidate for attorney general, tweeted: “Terrible idea. Tearing down our history will not be unifying, and all should be concerned about a government that attempts to erase history.”

Aides to Northam responded to those tweets by quipping that museums teach history.

Removing Confederate monuments in Virginia involves several legal hurdles that could complicate Northam’s proposal.

Supporters of Confederate heritage often point to a state statute that says Virginia towns have no authority over war memorials inherited from past generations. But a Danville judge ruled legal protections do not apply to memorials erected before 1998. Still, officials in Loudoun County and Alexandria determined they could not remove their Confederate memorials under state law.

Last year, McAuliffe vetoed a bill that would have strengthened protections for Confederate monuments by prohibiting cities and counties from removing war memorials.

Laura Vozzella contributed to this report.