ANN ARBOR, MI - Libertarian presidential candidate Gary Johnson sued Michigan's secretary of state on Monday, demanding a spot on the November ballot after apparently missing a deadline to withdraw as a Republican by just three minutes.

Johnson, the former governor of New Mexico, sought the GOP nomination for president last year before later announcing his Libertarian bid in December. State election officials notified him that his name would appear on the February presidential primary ballot unless he withdrew.

He missed a 4 p.m. Dec. 9 deadline by three minutes, according to a lawsuit filed against Secretary of State Ruth Johnson, a Republican, in the Detroit federal courthouse. Under state law, losing the GOP primary disqualified him from running with a party affiliation in the general election.

Gary Johnson, along with the Libertarian Party of Michigan and its chairwoman, is asking U.S. District Judge Paul Borman to strike down the state's "sore loser" law as unconstitutional.

The suit accuses the state of violating due process, equal protection, voting and other rights granted by the First and 14th Amendments. It also says Michigan has never before applied the sore loser law.

Johnson could be allowed to run as an independent if he gathers at least 30,000 valid signatures by July 19 - something Libertarians say is proof the existing law should not stand up in court.

Not allowing Johnson to run as a Libertarian but letting him try as an independent shows there is "scant state interest" in applying the sore loser law to presidential candidates, the suit says.

Gisgie Gendreau, a spokeswoman for the secretary of state, said while it would be premature to comment on the lawsuit itself, state law required that Johnson's name not go on the November ballot.

In 2008, Libertarian presidential candidate Bob Barr received under 24,000 of about 5 million votes cast in Michigan, or less than one-half of 1 percent. It is a tiny amount that had no bearing on Barack Obama's comfortable win over John McCain.

But if the race between Obama and presumptive Republican challenger Mitt Romney is razor-thin in Michigan (think Florida in 2000), the lack of a Libertarian in the contest could be an issue.

Johnson is expected to run stronger in the Mountain West. But it is uncertain if he can excite voters nationwide to the same degree that GOP candidate Ron Paul has.

Email David Eggert at deggert1@mlive.com and follow him on Twitter @DavidEggert00