Minnesota Secretary of State Mark Ritchie must immediately shut down the online voter registration system he launched last year because he lacked the authority to create it, a Ramsey County judge decided Monday.

Ramsey County District Judge John Guthmann said Ritchie had until midnight on Tuesday to close the system and confirm that he had done so by Wednesday.

More than 3,600 Minnesotans have taken advantage of online registration. Guthmann said his order "does not invalidate any online voter registration accepted before midnight on April 29, 2014."

Guthmann said he also was making no determination on whether online registration was a good idea. Instead, he wrote, "sole question presented herein is whether Respondent had the legal authority to do what he did."

His ruling revives political opponents' most frequent complaint about Ritchie — that he has a pattern of overstepping his bounds. In 2012, the Minnesota Supreme Court agreed, saying the two-term DFL leader of the state's election system went beyond his power when he tried to write new titles for constitutional amendments. That same year, Republicans said he used his office's resources to campaign against the amendment requiring voter ID.

"In my opinion this is a ­Secretary of State that has had little respect for the law," said Dan McGrath, president of Minnesota Majority, one of the groups that sued over the registration issue.

Ritchie, who is not running for re-election, said he disagrees with Guthmann's ruling, but appreciates that the Legislature has taken up the call to allow Minnesotans to register to vote online.

The DFL-led Senate had planned to vote on the matter Monday, but opted to wait a day.

"We look forward to the Minnesota Legislature making online registration permanent," Ritchie said in a statement. "This tool has already proven its ability to reduce taxpayer costs by modernizing the work of local government."

Since the uproar over the system Ritchie created, lawmakers have been moving to approve a web-based voter registration. Guthmann cited their work in his decision to rule against the secretary of state.

"If the Legislature believed that the existing online voter registration tool was already legally authorized," Guthmann wrote, "there would be no need for new legislation." Last year, both Democrats and Republicans said Ritchie may have gone too far by creating online registration without any legislative purview.

When lawmakers reconvened this year, they quickly began crafting their own measures to authorize such registration. Earlier this month, the Minnesota House overwhelmingly passed a measure authorizing a system similar to the one Ritchie created, but with extra security safeguards. Even Republican lawmakers who brought the lawsuit against Ritchie voted for it, said Rep. Steve Drazkowski, a Republican from Mazeppa who joined with three House colleagues in bringing the suit.

"There is a real appetite in this place to do it," said Rep. Steve Simon, DFL-Hopkins and the sponsor of the House measure. About half of states already offer online registration in some form.Simon, who is running to replace Ritchie, had said last year the law was unclear as to whether the secretary of state had the authority to create the system he did. Monday's decision, Simon said, "confirms my own instincts, which … are to consult the Legislature when in doubt."

Sen. Katie Sieben, DFL-Newport, who is carrying the Senate bill, said the Senate will pass online registration Tuesday, sending the bill to DFL Gov. Mark Dayton for his ­signature.

"As things stand today, my intention is to sign the bill," Dayton said.

If Dayton signs the bill into law as soon as he gets it, there may be little gap between Tuesday's system shutdown and when the legally authorized system goes live.

"We are doing it as quickly as we can," Sieben said.

Rachel E. Stassen-Berger Twitter: @RachelSB