Voters in Arizona and New Jersey on Tuesday voted to legalize recreational marijuana use.

The constitutional amendment will allow the possession, sale, and use of cannabis for New Jersey residents 21 and over. New Jersey Gov. Phil Murphy campaigned on legalization in 2017 but lawmakers hit a stalemate when they attempted to address the issue in the state legislature.

New Jersey becomes the 12th state to legalize marijuana for recreational purposes.

The ballot question was approved by voters in all 21 counties, the New York Times reported.

"We did it, New Jersey," Gov. Phil Murphy tweeted. "Public Question #1 to legalize adult-use marijuana passed overwhelmingly tonight, a huge step forward for racial and social justice and our economy."

New Jersey officials still have ways to go. They have to establish rules related to regulating and testing cannabis and issuing licenses. In addition, New Jersey officials have to figure out how many permits to grant and to whom.

Surrounding states like New York and Pennsylvania may feel pressure in upcoming months to support the legalization of marijuana or risk losing the financial edge to New Jersey in what is expected to be one of the largest marijuana markets in the U.S.

In Arizona, voters passed Proposition 207, which was designed to allow anyone 21 or older to have up to 1 ounce of cannabis.

The 16% tax on its sale will fund community colleges, public safety, public health programs, and roads and highways.

The legalization of marijuana in Arizona had been predicted to generate upwards of $300 million annually. However, smoking in a public place will be considered a petty offense.

About 60% of voters said yes to the proposition at the time it was called by the Associated Press.