RICHMOND, Va. (AP) — The Democrat-led Virginia General Assembly finished much of its work for the year Saturday, passing the state budget, and approving a marijuana legalization bill and dozens of other pieces of legislation.

Lawmakers worked late into the night, putting the final touches on bills and hashing out last-minute compromises in conference committees. The part-time legislature effectively wrapped up a busy session that was reshaped due to the coronavirus pandemic, though they will convene briefly Monday for parliamentary reasons.

With Democrats in full control of the state government for a second straight year and facing key elections in the fall, the session has seen the passage of legislation that will bring more sweeping policy changes to Virginia. Lawmakers have voted to abolish the death penalty, expand job-training at community colleges, get more electric vehicles on the road and tighten gun laws.

“Our House Democratic Majority has kept its promise to protect families, keep Virginia healthy and rebuild our economy stronger,” House Speaker Eileen Filler-Corn said in a statement.

Marijuana legalization was a top priority for Democrats and Gov. Ralph Northam, though it looked to be in trouble toward the end of the week. After days of difficult negotiations between members of the House and Senate, lawmakers sent a measure to Northam that would legalize up to an ounce of marijuana in 2024, at the same time retail sales would begin.

Lawmakers also gave final approval Saturday to a budget that funds key legislative priorities and pandemic relief efforts, boosts the state’s reserve fund and gives state workers and state-supported employees a raise.

Also passed Saturday was legislation to add six new judges to Virginia’s Court of Appeals.

Democrats said the additional judges are needed to expand the intermediate court’s jurisdiction and give criminal defendants and civil litigants an automatic right of appeal, something every other state in the country now provides.

The legislation drew opposition from some Republicans who accused Democrats of “court packing” to try to change the political makeup of the court to push a liberal agenda.

Under current Virginia law, the only cases granted automatic hearings with the court are those involving domestic issues, such as divorces and adoptions; workers compensation claims; and administrative law cases. In all other civil cases, people must ask the Supreme Court of Virginia to hear their appeals.

In criminal cases, litigants must file a request for the court to hear an appeal, but the court only hears a fraction of those cases.

One key Democratic criminal justice reform bill died at the last minute. Negotiators working on a bill to eliminate mandatory minimum sentences failed to reach a compromise.

The original Senate bill sponsored by Sen. John Edwards called for eliminating nearly all mandatory minimum sentences attached to criminal offenses in Virginia — more than 200 — with the exception of the murder of a law enforcement officer, which would carry a mandatory sentence of life without the possibility of parole. In the House, Del. Mike Mullin sponsored a bill that called for eliminating mandatory minimums for approximately two dozen crimes, including various drug offenses, the illegal sale of alcohol, and some firearms offenses. The bill called for keeping mandatory minimums in place for violent crimes and sex offenses.

Many of the penalties were adopted in the 1990s as part of the tough-on-crime movement, which some lawmakers blame for mass incarceration.

Lawmakers also worked through a calendar of dozens of other bills Saturday. Among those that won final passage:

— Measures that would make it easier for first responders and certain health care workers who contract COVID-19 to get workers compensation pay.

— A Freedom of Information Act reform bill that would make criminal investigative files in cases that are no longer ongoing publicly available, with limited exceptions.

— A measure that would ban firearms within the state Capitol and the surrounding area.

The House of Delegates has done its work virtually this year due to the coronavirus pandemic, a setup that led to concerns from the Republican minority and some transparency advocates. The smaller Senate has been meeting at a science museum where the larger space allowed for social distancing.

After Monday’s pro forma meeting, lawmakers will reconvene briefly in April to consider bills the governor returns with recommended changes.