LANSING, Mich. -

An Ingham County judge has ordered Michigan election officials to stop tabulating about 18,000 write-in ballots from Detroit's mayoral primary due to a lawsuit.

Circuit Court Judge Joyce Draganchuk has filed a temporary restraining order restricting the State Board of Canvassers from counting and recounting the ballots. They also are restrained from certifying the primary election.

Etta Wilcoxon, a candidate for Detroit city clerk, filed the lawsuit which claims the board violated the state constitution when they began their process of reviewing the write-in votes.

View: Judge's order

A show cause hearing is scheduled for Tuesday, Sept. 3.

Read more: State election officials wrap up review of Detroit ballots

Wayne County canvassers referred the ballots to the state because they were tallied numerically by the city instead of with hash marks.

County canvassers said they counted about 24,000 valid write-in votes for former medical center chief Mike Duggan and about 28,300 for Wayne County Sheriff Benny Napoleon.

Napoleon and Duggan finished ahead of the other candidates and will face off in the November general election.

However, the Aug. 6 election has yet to be certified because of the tallying issue.