Maine residents have voted to legalize marijuana for recreational use in their state.

The final results of the referendum were tabulated on Thursday. The count took nearly two days because of how close the race was, within a fraction of a percentage point, and The Associated Press made the call Thursday afternoon.

Supporters had already declared themselves the winners and had predicted home cultivation of marijuana would be legal by around Christmas.

"The Maine people have passed it, and we should work on implementing it," said Republican state Sen. Eric Brakey, of Auburn, who supported the ballot issue.

Medical marijuana was already legal in Maine.

People 21 or older will now be allowed to use up to 2 1/2 ounces of marijuana, and retail marijuana shops and social clubs could open around the state. Some municipalities have balked at allowing such businesses to open in their communities.

Opponents who had vowed to request a recount said on Thursday that they would meet to decide what to do next.

"We need to look at the numbers," said Scott Gagnon, an organizer of a campaign against legalization that portrayed legalization as a threat to the health and safety of children.

The campaign that pushed for legalization turned immediately toward the implementation process on Thursday. They said they hope marijuana will be available in retail establishments by 2018.

Marijuana won't become available at the retail level until after a state rulemaking process that could be slow and arduous. David Boyer, campaign manager for Yes On 1, said the people who advocated for legal marijuana will also play a role in its implementation.

All of the marijuana sold in Maine will also be grown in Maine, he said.

"We're excited that Maine is going to join many other states that have decided to have a smarter marijuana policy — a policy that no longer punishes adults for smoking marijuana," Boyer said.

Gov. Paul LePage, who opposed legalization, did not respond to a request for comment on Thursday.

Pending the possibility of a recount, Maine joins California, Nevada and Massachusetts, which passed similar measures this week. Arizona rejected a similar measure. Recreational marijuana was already legal in Colorado, Oregon, Washington and Alaska.

In Maine, the proposal allows people to cultivate, distribute and sell marijuana and marijuana products. Marijuana is set to be taxed at 10 percent and subject to local restrictions.

Parents' groups and some law enforcement organizations opposed the proposal. The proposal also received scrutiny from members of the medical marijuana community, who say they fear it could replace the state's medical program.

The secretary of state's office said Thursday that the largest bloc of uncounted votes that remained were from more than 4,000 overseas absentee voters. Those were counted and failed to make the difference for those who opposed legalization.