RICHMOND — Virginia's General Assembly wrapped up work Friday on the state's pandemic-damaged budget and concluded an extraordinary special session in which lawmakers also passed sweeping measures to overhaul criminal justice and police oversight.

Fittingly for a session that convened Aug. 18 and dragged on far longer than expected, though, it still won’t technically be adjourned. A dispute among Democrats over language in the budget will leave that document incomplete until after next month’s elections.

The Senate passed the budget on a bipartisan 23-to-15 vote late Friday afternoon, with the House of Delegates following suit later, approving the spending plan on a bipartisan vote of 63 to 35. The action came on the 60th calendar day of the unusual gathering, making it nearly as long as the regular legislative session the General Assembly held earlier this year.

“Though it has taken a number of weeks to get here, this is still a great budget for the people of the commonwealth,” said state Sen. Janet D. Howell (D-Fairfax), chairwoman of the Senate Finance and Appropriations Committee.

“Together with our colleagues in the Senate, Virginia is now a national leader in the effort to pass necessary improvements to policing and criminal justice,” House Speaker Eileen Filler-Corn (D-Fairfax) said. “We came together and passed a fiscally responsible budget that provides relief for all Virginians, especially those struggling to get by.”

The proceedings were protracted partly because Democrats, who control both chambers, insisted on an ambitious agenda, and partly because of steps taken to protect members from the novel coronavirus. The Senate met in a conference room of the Science Museum of Virginia so members could sit far apart, and the House convened online in virtual sessions.

One of the final delays came as Senate Democrats insisted on including language in the budget to implement a proposed constitutional amendment on redistricting that’s on the Nov. 3 ballot. Many House Democrats oppose the amendment, saying it doesn’t go far enough to protect against racial gerrymandering.

As a compromise, the two sides have agreed to keep the budget open. If the amendment passes, Gov. Ralph Northam (D) can submit the redistricting language, and the Assembly can briefly reconvene to vote on the final passage.

Northam called for the special session to address a projected shortfall of $2.8 billion caused by the state’s response to the pandemic. During the regular session that adjourned in March, the General Assembly had passed a two-year, $135 billion spending plan that featured raises for teachers and state employees, along with generous new spending for social programs, education and health care.

Because of the shortfall, Northam ordered a freeze on all new spending. The modified budget he submitted to lawmakers ahead of the special session unfroze only small amounts of that spending, such as for housing and broadband expansion and for a modest deposit in the state’s reserve fund.

Northam warned lawmakers against using federal pandemic relief funds to cover virus-related expenses, saying it would limit his ability to respond to the ongoing health crisis when the legislature is out of session. He also threatened not to sign their proposed budget if they included significant “contingency” spending — ordering the governor to spend on certain items if the state’s revenue improves.

The agreement reached this week restores some spending that Northam had cut and backs away from some of the areas that had raised his objections.

House and Senate budget negotiators agreed to restore some funding for mental health services beyond Northam’s recommendations, and included money for public colleges and universities responding to the pandemic.

They also recommended providing a $1,500 bonus for state employees and state-supported local employees in fiscal year 2022, if revenue permit, and added a $500 bonus this year for police officers. The budget directs Northam to propose some type of pay increase for teachers in 2022 if there is enough money in the budget.

The plan calls for restoring about $37 million from Northam’s cuts for early-childhood education and about $35 million for at-risk pupils in public schools.

Lawmakers agreed to include $18.6 million in the budget to implement new laws regarding police oversight and criminal justice issues, along with $6.6 million for police body cameras.

Democrats followed through on promises to address issues of police brutality and racial injustice highlighted by the killing of George Floyd in Minneapolis police custody in May.

The House and Senate passed measures giving local governments the option to create civilian review boards with subpoena power to investigate alleged police misconduct. They also sent Northam bills giving the state’s attorney general the power to investigate allegations of systemic racism in law enforcement agencies.

They passed bills to ban chokeholds and no-knock warrants in most situations, make it easier to decertify police officers involved in wrongdoing, and establish minimum training standards for law enforcement agencies across the state. Officers who witness a colleague using excessive force would have a duty to intervene.

Other legislation sent to the governor would prohibit officers from stopping cars for certain physical defects or searching them based on an alleged whiff of marijuana — minor infractions that, advocates said, police have used as pretexts for racially motivated stops.

Sexual relations between law enforcement and people in their custody — something already prohibited in many states — would be outlawed.

The House and Senate approved a bill to create a “MARCUS Alert,” which would create “community care teams” led by mental health professionals that would respond along with police to emergency calls related to mental health crises. Senate approval came Friday on a bipartisan 26-to-12 vote.

The measure is named for Marcus-David Peters, a 24-year-old Richmond teacher shot and killed by Richmond police during a mental breakdown in May 2018.

The House and Senate, though both led by Democrats, disagreed sharply in some areas. The House passed a bill that would have made it easier to sue police for misconduct by eliminating qualified immunity, the legal doctrine that shields officers from civil liability if there is any ambiguity surrounding whether their actions were justified. But a Senate committee defeated it.

The Senate’s approach, eventually adopted by the House as a compromise, attempts to chip away at that protection by spelling out in the state code when officers may use force, thereby eliminating uncertainty about whether it was justified.

Debates on two criminal justice measures went down to the wire. A Senate bill allowing criminal defendants who are convicted by a jury to opt for sentencing from a judge narrowly passed both chambers. But a House bill to allow people convicted of crimes to have their records expunged after a period of time was blocked by the Senate. Lawmakers vowed to take that issue up again in the regular session that convenes in January.

“The special session was a great opportunity for legislators to come together and make real, progressive, well-needed reform when it came to police accountability and racial justice,” said Ashna Khanna, legislative director of the American Civil Liberties Union of Virginia. “We’ve seen some steps forward but Virginia has a very long way to go when it comes to racial justice and police accountability.”

The view was more mixed for law enforcement, said Wayne Huggins, executive director of the Virginia State Police Association. He praised efforts to enhance training and make it easier to “get rid of bad officers.”

But he expressed concern about other measures. He said a ban on pulling drivers over for mechanical deficiencies with the car will make the roads less safe. And he said there is sometimes a need for a no-knock warrant.

“No-knock warrants are very, very, very infrequently used, but when they are used, generally it’s because someone’s life is in danger or to stop the destruction of evidence,” Huggins said.