AUGUSTA, Maine — A Superior Court judge has overturned Secretary of State Matt Dunlap’s ruling that a citizen petition for a referendum to legalize recreational marijuana in Maine was invalid.

Superior Court Justice Michaela Murphy made the decision in a 26-page ruling issued Friday. She ruled that Dunlap “committed an error of law by applying a vague, subjective and/or unduly burdensome interpretation” of the law.

She wrote that variations in signatures are understandable, given how citizen petitions are conducted.

Murphy’s decision puts the question back on track to appear on the November state ballot. Dunlap now will have time to take a fresh look at the signatures to determine whether petitioners submitted enough valid ones to qualify for ballot placement.

“It involves standing in streets, shopping malls, public places and town halls, in both foul and fair weather, and asking for the voters’ support,” Murphy wrote. “Notaries are often asked to administer an oath in the midst of these less than ideal circumstances. The court finds that requiring a notary to perfectly reproduce his or her commission signature in light of these realities is unduly burdensome to this absolute constitutional right to initiative.”

Dunlap said he is studying the decision and what it means. Under law, he has three days to decide how to proceed.

“We are reviewing the impact of this decision and considering our options at this time,” said Dunlap in a written statement.

The appeal was filed shortly after the secretary of state’s office invalidated the citizen petition in early March. Petitioners for An Act to Legalize Marijuana turned in more than 99,000 signatures, but only 51,543 could be verified — far short of the statutory threshold of 61,123 valid signatures of registered Maine voters.

The secretary of state’s office identified the following reasons for the invalid signatures:

— 31,338 were invalid because the circulators’ signatures did not match the circulators’ signatures or the signature of the notary listed as having administered the oath.

— 13,525 signatures were invalidated because they were not certified as belonging to registered voters in Maine.

— The remaining signatures were invalidated for reasons ranging from paperwork errors to signatures that could not be verified.

More than 17,000 of the invalid signatures were rejected because the signature of a single notary, Stavros Mendros of Lewiston, did not match the signature the state has on file. Mendros has said he signed the documents.

An attorney for the Marijuana Policy Project argued in Maine Superior Court last month that the secretary of state’s office erred in its interpretation of of a 2009 state law requiring notaries to sign documents “in the same form” as their signatures on file.

The citizens initiative seeks to legalize the possession, purchase, growth and sale of marijuana for Mainers 21 years old or older. Initially two groups started collecting signatures for competing marijuana legalization ballot questions, but they joined forces during the signature-gathering process.

Legalize Maine spent more than $100,000 on the initiative through the end of 2015. The Campaign to Regulate Marijuana Like Alcohol spent about $218,000 in that same time period. Both organizations’ first-quarter financial reports for 2016 are due Monday.

David Boyer, campaign manager for the Campaign to Regulate Marijuana Like Alcohol, said he was “extremely pleased with the court’s decision.”

“This re-review should now be a mere formality,” he said. “Once the secretary of state’s office has completed its work, we look forward to launching the formal part of our campaign and educating Maine voters about the benefits of regulating marijuana like alcohol.”

Boyer said that since the Legislature is still in session and the November ballot is still under development, there should be “plenty of time” to get the question decided by voters this year.

Earlier this week, Murphy ruled against proponents of another citizen-initiated referendum that sought to make way for a casino in York County.

Christopher Cousins has worked as a journalist in Maine for more than 15 years and covered state government for numerous media organizations before joining the Bangor Daily News in 2009.