(Bloomberg) — Illinois lawmakers voted Friday to legalize recreational marijuana, becoming the 11th U.S. state to do so and bolstering Governor J.B. Pritzker’s efforts to shore up the finances of the cash-strapped state.

Illinois is the fifth most populous state, with a population of nearly 13 million.

The House of Representatives passed the measure that allows the purchase and possession of cannabis by those who are 21 and older starting in 2020. The Senate approved the bill on Wednesday. Pritzker, who took office in January, had made legalization a key platform in his campaign and said soon after the legislation passed that he will sign it. The billionaire Democrat’s budget proposal for the year that starts July 1 included an estimated $170 million from the sale of producer licenses.

Illinois joins a growing movement to end the prohibition of the drug: 10 other states and the District of Columbia have legalized recreational pot in the past seven years, according to the National Conference of State Legislatures. Illinois’s move follows Michigan, potentially creating a hub in the Midwest.

A recent effort in New Jersey to legalize recreational marijuana in the state legislature was scuttled due to bad blood between Gov. Phil Murphy and St. Sen. Steve Sweeney. On Thursday, however, the Senate voted in Trenton to pass a bill to expand the state’s medicinal cannabis program. Gov. Murphy is expected to sign it.

In Pennsylvania, several bills to legalize cannabis for adult recreational use are pending.

The Illinois bill also allows for some drug convictions to be expunged. Convictions for amounts of cannabis up to 30 grams would be dealt with through the governor’s clemency process, and for amounts 30 to 500 grams, the state’s attorney or an individual can ask the court to vacate the conviction.

The cash from taxation and licenses is needed as Illinois struggles with chronic budget shortfalls, about $7 billion of unpaid bills and state pension funds that are short $134 billion. The fiscal pressures have pushed its credit rating to one level above junk-grade, making Illinois the lowest rated U.S. state.

Illinois is the second state after Vermont to legalize recreational marijuana through the legislature, while other states used ballot initiatives, according to the National Conference of State Legislatures.

—With assistance from Craig Giammona.