RICHMOND — The General Assembly ended a special legislative session Monday evening some 12 weeks after it began, putting the finishing touches on the state budget and approving changes recommended by Gov. Ralph Northam (D) to a handful of bills related to criminal justice and the novel coronavirus.

Both the House of Delegates and the state Senate agreed to language in the two-year, $135 billion spending plan to set up a bipartisan commission on redistricting under a constitutional amendment approved last week by voters.

That language held up final passage of the budget last month. Many House Democrats opposed the redistricting amendment, saying it didn’t do enough to ensure minority participation in drawing political boundaries. Senate Democrats — and most Republicans — supported it as a way to end gerrymandering.

Lawmakers had resolved the impasse by putting off action until the fate of the constitutional amendment could be decided on Election Day. Now that Virginians have decisively approved it, Northam recommended budget language to get the commission underway.

The language sets out rules governing how it will operate, including a prohibition on leaders of the General Assembly appointing themselves to the body and a requirement that citizens chosen to participate reflect geographic, racial and gender diversity.

The language passed 99 to 0 in the House, though several members said they were disappointed by the outcome. Del. Marcia S. “Cia” Price (D-Newport News) said the process by which the governor created the budget language had been “behind closed doors,” also criticizing a lack of ethics requirements for commission members.

The Senate passed the measure without discussion.

Lawmakers also approved Northam’s recommendation to add $1 million to the state budget to pay for an independent investigation of the “culture, policies and practices” within Virginia Military Institute after a recent outpouring of complaints about racial intolerance there.

That measure passed the House on a party-line vote of 52 to 46 after Del. Kirk Cox (R-Colonial Heights) spoke against it, saying that while incidents of racial intolerance at VMI described in the media were “unacceptable,” he felt the matter should be left to the university to investigate.

“I think this is a dangerous precedent for our political leaders to substitute their judgment for the board of visitors,” Cox said, adding that he had little confidence the outside investigation would be truly independent.

The Senate also passed the measure on a split vote. Minority Leader Thomas K. Norment Jr. (R-James City) — a graduate of VMI — supported the investigation but blasted Northam for requesting the resignation of VMI’s superintendent, retired Gen. J.H. Binford Peay III, ahead of the probe. “You cannot let the media lynch VMI,” Norment said.

The special legislative session, which convened on Aug. 18, was initially aimed at repairing the ravages the coronavirus pandemic inflicted on state finances.

But after a summer of protests over police brutality against African Americans, the Democrats who control the legislature added an ambitious agenda of criminal and social justice issues.

The session was drawn out by extraordinary steps to keep lawmakers from spreading the virus, with the House of Delegates convening online and the Senate meeting in a cavernous conference room at the Science Museum of Virginia so that desks could be spaced far apart.

Northam has already signed most of the measures passed to overhaul policing practices. But he recommended changes to one aimed at limiting the circumstances in which a police officer can pull over a vehicle and conduct searches after smelling marijuana — a practice that Democrats say is used disproportionately against Black motorists.

After law enforcement officials expressed concern about the bill, Northam amended it to make it clear that officers can still pull over a vehicle for having no brake lights or no headlights after dark. The House and the Senate approved that change on Monday.

Both chambers also approved minor fixes to a bill that awards sentencing credits to terminally ill prisoners.