RICHMOND — Virginia's legislature has agreed to legalize marijuana and abolish the death penalty, a dramatic turn for a state once so opposed to change that it mounted "massive resistance" against school integration and stood by its Confederate statues for 155 years after the Civil War.

Friday's votes in the General Assembly make it all but certain Virginia will become the first Southern state to allow legal marijuana sales and end capital punishment. Although both bills need details ironed out, Democrats who control the Senate and House of Delegates wield enough votes to send the measures to the desk of Gov. Ralph Northam (D), who has promised to sign them.

"It is historic, it is transformational," House Speaker Eileen Filler-Corn (D-Fairfax) said in an interview. "Virginia is changing, and some of these historic pieces of legislation — it's what the public wants."

Two Republicans joined all Democrats in the House of Delegates on Friday in approving the death penalty bill, 57 to 41. The Senate had approved a similar bill on Wednesday.

The House and Senate both voted Friday for plans to legalize marijuana that call for retail sales to begin in 2024.

The actions capped a busy day that saw several other ambitious measures advance, from ending mandatory minimum sentences on a host of crimes to overhauling utility regulation and passing job and health protections in response to the coronavirus pandemic. Friday was "crossover," the deadline for each chamber to finish work on its own bills and send them to the other.

The flurry also signaled another milestone in the transformation of Virginia into a liberal, blue state after decades of conservative Republican leadership in the General Assembly. The makeover was turbocharged last year when Democrats used election gains to take control of both chambers of the legislature, fueled by voter antipathy to President Donald Trump.

With more women and minorities in positions of power than any time in the General Assembly's 402-year history, Democrats have pushed sweeping changes in areas such as gun control, voting access, gender rights and criminal justice.

The extent of Virginians' appetite for change will be tested this fall in elections for all 100 seats in the House of Delegates, as well as for governor, lieutenant governor and attorney general.

However, there was more potential Republican support for both abolishing the death penalty and legalizing marijuana than the votes reflected.

The House voted 55 to 42 for the marijuana bill — a party-line split, though three Republicans opted not to vote. In the Senate, the 23-to-15 vote saw two Republicans join all the Democrats in supporting legalization. One Republican didn’t vote.

Del. Nick Freitas (R-Culpeper) said he supports legalization but voted against the House bill because the proposed approach creates too much government involvement in the marketplace. Freitas said he was “hopeful” that changes could be made in conference committee that would allow him to eventually support it.

While there are differences in the details of the House and Senate versions that need to be reconciled, both envision setting up a state agency to regulate the industry and placing tight caps and requirements on retail licenses.

A state study has suggested that regulating a cannabis industry would bring in some $300 million a year in tax revenue.

Del. James A. “Jay” Leftwich Jr. (R-Chesapeake) warned that legalizing marijuana could cause public health problems, citing studies that found increased risk of mental health issues among young smokers, and invoked the specter of organized crime.

Democrats said many legal pharmaceuticals are more dangerous than marijuana.

“There is already a thriving $1.8 billion . . . marijuana market right now in the commonwealth of Virginia,” said Del. Don L. Scott Jr. (D-Portsmouth). “Here is our opportunity to make it safer, to regulate it, to get tax revenues from it.”

During Senate debate, some Republicans expressed anger over the issue.

“I find it inexcusable that this administration has devoted more time and energy and effort into getting THC into the bloodstreams of our minority community than it has in getting the coronavirus vaccine into the bloodstreams of our minority community,” said Sen. Mark J. Peake (R-Lynchburg), referring to the chemical compound that gives marijuana users a “high.”

But Senate Majority Leader Richard L. Saslaw (D-Fairfax) countered that fears about legalization are overblown. “I don’t want to be a wise guy and say it’s high time we did something about marijuana, but the fact is, the time has arrived,” Saslaw said. “We’ll get it straight. It won’t be the end of the world.”

On capital punishment, a few Republicans in the House said they would consider supporting abolition if they had faith that life sentences could truly be made permanent, with no possibility of parole. The House version of the bill contains language allowing life without parole, but Republicans noted several recent instances of violent offenders winning early release.

The Senate version of the bill opens the possibility of parole in some cases, which also cost potential Republican votes in that chamber.

The two versions are ultimately likely to be reconciled in a conference committee over the next few weeks.

Virginia conducted the first recorded execution in what’s now the United States — in 1608 — and over the centuries has put more people to death than any other state, at 1,389. In recent times, however, the use of the penalty has fallen. There are only two prisoners on death row in Virginia, and the penalty has not been used extensively in many years.

Some Republicans argued that the option needs to be preserved for the most heinous cases.

“There will always be someone who chooses depravity and evil over good,” said Del. Jason S. Miyares (R-Virginia Beach). Society needs to be able to administer the ultimate punishment in such cases, he said. “It’s not vengeance, it’s justice.”

Democrats said capital punishment has been applied in a racist way, citing studies that show Black defendants are far more likely to face execution than White prisoners.

“The death penalty is the direct descendant of lynching. It is state-sponsored racism,” said Del. Jerrauld “Jay” Jones (D-Norfolk).

In the shadow of those big-ticket issues, lawmakers took action on several other items Friday that showed the extent of Democratic efforts to reshape state policy.

Democrats are pushing major changes to address what they say is a criminal justice system that unfairly targets people of color and places too much emphasis on harsh punishment.

On bipartisan votes, the Senate agreed to ban solitary confinement in prisons under most circumstances and to give convicted people the right to seek a new trial if their convictions were based on discredited "junk science."

The House endorsed an amendment to the state's constitution to provide for the automatic restoration of voting rights for convicted felons, while the House and Senate passed measures that would end the imposition of mandatory minimum sentences for most crimes.

Both chambers have passed a number of measures intended to address the pandemic, including bills meant to make it easier for health-care providers to distribute doses of vaccine as volunteers. The House has passed a bill to provide paid sick leave for front-line workers, but it could face trouble in the more business-friendly Senate, which has only passed a bill to study the issue.

For Senate Republicans, the biggest win was strong bipartisan support for a bill by Sen. Siobhan S. Dunnavant (R-Henrico) requiring schools to offer in-person and remote education. The measure, which would take effect July 1, does not spell out how schools should do that.

Both chambers have approved measures meant to codify elections changes made because of the pandemic, including the use of drop-off boxes for absentee ballots. Other bills would require localities to begin processing absentee ballots sooner, either as they arrive or before polls close on Election Day. Currently, localities are allowed to process them early but are not required to.

The threat of the virus has loomed especially heavily over the Senate all session, which lost a member, Sen. A. Benton Chafin (R-Russell), to the disease Jan. 1. For the first time, the upper chamber allowed members to participate remotely if they were infected or exposed.

Two of the remaining 39 senators were quarantining when the session opened Jan. 13, and by Friday, the same was true for two others: Senate Minority Leader Thomas K. Norment Jr. (R-James City) and Sen. Amanda F. Chase (R-Chesterfield).

Chase, a Trump-style populist running for governor, is the only senator who has refused to wear a mask on the floor. She normally sits in a three-sided plexiglass box to isolate her from others. She said via text Friday that she might have been exposed to the virus while campaigning at a gun show last weekend. She said she was tested Thursday night and was awaiting results.