The new law will be implemented by July, after Lt. Governor Justin Fairfax broke a 20-20 tie in the state legislature.
Gov. Ralph Northam tweeted his support for the measure earlier in the day on Wednesday, saying "Today, Virginia can make history as the first state in the South to legalize the simple possession of marijuana—and restore justice to those harmed by decades of over criminalization."
Both chambers of the Virginia General Assembly passed legislation in February that would legalize marijuana for adult recreational use, with retail sales starting several years down the road.
Last week, Northam proposed accelerating the schedule for permitting possession to this summer – three years ahead of schedule.
If the legislation is signed into law, Virginia would join 15 other states and the neighboring District of Columbia in legalizing small amounts of marijuana for adult recreational use.
The Associated Press contributed to this report