ALBANY – For years, the idea of legalizing marijuana for recreational use in New York was a long shot.

The public was wary. Gov. Andrew Cuomo was opposed. And law-and-order Republicans in the state Senate would never go for it.

Things have changed.

For the first time, recreational marijuana will be on the table in Albany in a serious manner when state lawmakers return to the Capitol in 2019.

Cuomo, a Democrat, has slowly thrown his support behind the issue and has pledged to push to legalize and regulate marijuana for leisure in early 2019.

Never before has New York been closer to legalizing the drug for recreational use, though key lawmakers caution that there's still more work to be done.

Here's what's made it happen:

Changing public opinion

Rarely has the general public's position changed on an issue as rapidly as it has on recreational marijuana.

At the start of 2014, 41 percent of New York voters supported and 54 percent opposed legalizing marijuana for recreational purposes, according to a Siena College poll.

Four years later, it's flipped: An April 2018 Siena College poll found 52 percent supported it and 44 percent opposed it.

More: Marijuana legalization in New York: Here's the money behind politically charged pot war

That's a very sharp trend toward support for legalization. It's no coincidence that more and more politicians are throwing their weight behind it.

"There's a tremendous amount of momentum building in New York," said Melissa Moore, deputy New York director for the Drug Policy Alliance, which hosted a two-day conference on marijuana legalization in Albany last week.

Cuomo changes his mind

Cuomo is the biggest New York name to change his mind on marijuana. And since his approval is needed, his switch in the most consequential.

The governor had long been wary of expanding access to marijuana in the state, reluctantly backing a medical marijuana program in 2014 while maintaining his opposition to recreational forms.

More:Andrew Cuomo's changing position on marijuana: A timeline

That changed earlier this year, when Cuomo ordered the state Department of Health to study the impacts of marijuana legalization. It was originally supposed to be completed before the end of the year, but the timeline was moved up considerably with Cuomo in the midst of a primary challenge from Cynthia Nixon, who supported legalization.

The study, completed in July, concluded the benefits outweighed the drawbacks.

Now, a task force appointed by Cuomo is coming up with legislation to make marijuana legal for recreational use in New York. Supporters of marijuana legalization are hoping Cuomo includes it in his state budget, which he has to introduce next month.

And on Monday, Cuomo gave his most explicit endorsement of legalized marijuana yet.

"We must also end the needless and unjust criminal convictions and the debilitating criminal stigma," Cuomo said in a speech in Manhattan. "Let's legalize the adult use of recreational marijuana once and for all."

Democrats take control

Democrats running the state Legislature — along with Cuomo's change of heart — is the biggest reason recreational marijuana has momentum in New York.

Republicans were in control of the state Senate when New York approved medical marijuana in 2014. The party was much less enthusiastic about recreational marijuana, however, and never allowed it to come to a vote.

Come January, Democrats will be in charge thanks to some big wins on Election Day.

But that doesn't necessarily mean legal marijuana is a done deal.

There are many thorny issues to negotiate, such as what happens to the records of those with marijuana possession convictions and what to do with any revenue from a tax.

Sen. Liz Krueger, D-Manhattan, sponsors a bill that would legalize and regulate recreational marijuana. She recently gave a presentation on the bill to her Democratic colleagues.

"I made a presentation but I didn't ask for a show of hands, so I don't really know," Krueger said. "People asked excellent questions that reflected exactly the kinds of concerns that I thought they would have."

Other states act

Ten states and Washington, D.C., have legalized marijuana (in small quantities) for recreational use, according to the National Conference of State Legislatures.

Two of those states — Vermont and Massachusetts — border New York, while New Jersey is considering legalization, too.

Add in Canada, which recently legalized marijuana, and there are no shortage of quick trips for New Yorkers to purchase the drug legally (though it remains illegal to transport it across state lines).

That also means the tax revenue from marijuana sales stays with those states and Canada — not in New York.

Cuomo has repeatedly cited the neighboring states' legalization as a reason for rethinking his stance on marijuana.

So what happens now?

The next steps come in January, when the state Legislature is scheduled to return to the Capitol.

Then, all eyes will be on Cuomo. If he includes a marijuana legalization bill in his budget proposal, it would add significant strength to the push.

On Monday, he suggested he would do that. Cuomo included marijuana legalization in his agenda for the first 100 days of 2019.

Krueger said she's hopeful Cuomo will include it in the budget. Her conversations with Cuomo's office have left her "optimistic," she said.

On the Assembly side, the recreational marijuana bill is sponsored by Crystal Peoples-Stokes of Buffalo, a Democrat who could be in line to become the chamber's powerful majority leader.

She acknowledged there's "still a bit of a ways to go on this."

"It's not a done deal," Peoples-Stokes said Wednesday at the marijuana conference.

"There is still a lot of conversation to be had not just at the governor's office, but I think in the Legislature."

JCAMPBELL1@Gannett.com

Jon Campbell is a staff writer for the USA TODAY Network's Albany Bureau.