A bill that would legalize marijuana in New York has gained steam in recent weeks, with a vote on the measure possible by the end of the legislative session next week.

The bill was discussed in closed-door conference by Assembly Democrats late into Thursday evening. Sources said the bill appeared to have strong support within the Democratic conference.

Senate Democrats on the other side of the Capitol, meanwhile, have also spent the last two days discussing the bill, and the conversations have been deemed largely positive.

Lawmakers are scheduled to depart Albany for the year next Wednesday.

Marijuana legalization would set up a retail system for cannabis sales, regulate the commercial, medical and hemp industries under one new agency, the Office of Cannabis Management.

The bill would also expunge records of those convicted of low-level marijuana offenses and divert revenue to communities affected by the war drugs. Revenue from sales would also be used to study the effect of drug use.

A Siena College poll this week found more than half of voters polled statewide support legalization.