DETROIT -- Polls have closed in Detroit as voters cast ballots to narrow a crowded field of mayoral candidates down to two, even as many residents wondered what role their next leader will have with an emergency manager now in charge of the checkbook.

A county sheriff who formerly served as Detroit's police chief and an accountant who lost three previous bids for mayor figured to draw the most support of the 14 candidates on Tuesday's nonpartisan primary ballot. But, a former medical centre chief was waging a serious write-in campaign that could make tabulations last well into the night -- if not longer.

The top two vote-getters for mayor will move on to the November general election, but that winner will take over an office in January with no immediate control over city finances or Detroit's future. State-appointed emergency manager Kevyn Orr, who controls the city's finances, last month made Detroit the largest city in U.S. history to file for bankruptcy.

City Elections Director Daniel Baxter told The Detroit News that about 36,000 voters -- or 6.8 per cent of those eligible -- had cast ballots. Baxter earlier projected a 15 to 17 per cent voter turnout for the nonpartisan primary that also featured City Council, City Clerk and other races.

Wayne County Sheriff Benny Napoleon and accountant Tom Barrow were considered the top candidates on the ballot, while former medical centre director Mike Duggan was seeking the job as a write-in after a residency issue kicked him off the ballot. His candidacy was complicated, though, by another write-in candidate with a similar name.

Leilani Thornton, 61, called Duggan the best qualified candidate to guide Detroit under an emergency manager and through a bankruptcy.

"He would know how to work within that system to help move the bankruptcy along faster," she said. "I saw firsthand what he did at DMC. I know he has great contacts and knows how to work with people."

For Virgie Rollins, who voted for Napoleon, a former Detroit police chief, the next mayor must be able to deal with the bankruptcy.

"Sheriff Napoleon can work with the federal government," she said. "He knows how to work with people there."

Some of the favourites for mayor have come out against the filing, and say they will work with Orr only if they have to.

"My pitch to him is, 'You're here to straighten out the finances. You have no municipal government experience,"' Napoleon said. "The emergency manager puts the budget together. The mayor should be able to set the priorities."

Napoleon and Barrow contend Orr was illegally appointed as emergency manager.

"In light of the bankruptcy filing, I don't believe he retains his power under state law," Barrow said of Orr. "Bankruptcy laws kick in. Those laws are explicit that the debtor is the municipality and its elected officials."

The 16 candidates -- including two write-ins -- are seeking to succeed Mayor Dave Bing, who is not seeking re-election. None of the candidates has name recognition outside the city like Bing, a former NBA great.

Uncertainty and failure have been standard operating procedure for years in once-mighty Detroit. Last month, it became the largest city in the U.S. to declare bankruptcy under the weight of massive debt brought on by crushing population decline and a history of political corruption and mismanagement.

Seeking to bring stability and turn the city around, GOP Gov. Rick Snyder appointed Orr, a national bankruptcy attorney, in March under a Michigan law that gives emergency managers nearly unlimited power.

On July 18, Orr made the Chapter 9 bankruptcy filing in federal court. He said Detroit is insolvent, unable to pay off debt that his restructuring team says could reach $20 billion. He has stopped paying on $2.5 billion in bonds, using that money to pump up struggling and underfunded city services. He also asked city creditors and Detroit's two pension funds to accept pennies on the dollar in money owed them.

"My preference would be for the governor to dissolve the emergency manager and let the mayor represent the city in bankruptcy court," said Duggan.

On Tuesday, Duggan joined his wife and two children to vote at a police precinct shortly after polls opened.

"Hopefully, we're up four votes right now," he joked.

Asked about the difficulties he faces not having his name on the ballot, Duggan said he doesn't think "people will have any trouble spelling my name" and that his campaign is "going to be fine."

Another candidate, barber Mike Dugeon, is seeking the job as well. He has never run for elected office and said he filed after being approached by a local television reporter over his name similarity with Duggan.

That could make tabulating the write-ins onerous and time-consuming. Following the primary, county canvassers will go over the spellings on each write-in ballot cast to determine who gets the votes.

Associated Press writer Mike Householder contributed to this report.