DETROIT - Moments after the polls closed Tuesday, WDIV-TV declared a winner: Freman Hendrix had defeated the incumbent mayor of Detroit, Kwame Kilpatrick, by a landslide.
Soon afterwards, the exit polls of WXYZ-TV checked in. They said it would be a little closer: Mr. Hendrix would have 53 percent.
There was every reason to suspect an easy victory for Mr. Hendrix. Kwame Kilpatrick, 35, the incumbent, had presided over an administration plagued with self-indulgence and scandal, splashed across the pages of Detroit's daily newspapers.
The city's independent auditor general said Detroit was headed for insolvency. In the August primary, Mr. Hendrix, now 55, coasted to first place. Every major media outlet, even the stoutly left-wing alternative newspaper, vigorously endorsed the challenger.
An expert on finance and a former deputy mayor in the businesslike Dennis Archer regime, Mr. Hendrix was seen as serious and competent. He had pledged to build bridges to the suburbs and do what it took to get the city's finances in order.
Even his worst enemies couldn't imagine him partying until dawn or using city funds for limousines and nightclubs.
And then the votes were actually counted.
The results were delayed many hours, in part because the FBI seized absentee ballots after charges of incompetence and corruption on the part of the longtime city clerk (who was, in an equally stunning surprise, defeated after allegations of voter fraud.)
Kwame Kilpatrick won re-election decisively, taking more than 53 percent of the vote. Young people turned out in greater numbers than expected, said pollster Ed Sarpolus. Voters under 40 went for Kwame Kilpatrick by more than 70 percent.
The poorest voters and the long-term unemployed, and those without any hope at all skipped the primary. But they came out last week to vote in droves for Kwame Kilpatrick.
Freman Hendrix appeared stunned. A week before, major newspaper polls showed him with a double-digit lead.
But things seemed to change swiftly at the end. It seemed clear that like George W. Bush in 2000, Kwame Kilpatrick unexpectedly benefited from televised debates. He is a spellbinding speaker; Mr. Hendrix is dry and matter-of-fact.
The mayor gave a particularly good speech at Rosa Parks' funeral just before the election. Freman Hendrix could only watch, and then was roundly criticized for signing autographs outside the church.
The challenger was damaged by a grainy, black-and-white commercial showing him angrily ordering an elderly woman protester removed, back when he was head of the city's reform school board. And in the final days, race became an issue in a town where all the candidates are black and nearly 90 percent of voters are African-Americans.
The Kilpatrick campaign bought a full-page ad showing lynching victims and the photos of journalists (including me) who it charged were part of a new "lynch mob" going after the mayor.
Mr. Hendrix was criticized for not being black enough because his mother was an Austrian war bride. Kilpatrick supporters routinely referred to him as Helmut. When the returns were in, Mr. Hendrix quietly asked all voters to do their best to help the mayor do his best, and to help get the city ready for the Superbowl this winter.
Kwame Kilpatrick said he had learned from his mistakes, which included leasing an expensive car for his wife's use and lying about it. He said he would no longer wear his diamond earrings, and would try to avoid the "tremendous mistakes in communication" he had made.
And Joe Harris, the city's outgoing auditor general, said none of this will make much difference. "The city can't sustain this rate of spending. They've been borrowing and have no more credit," said Mr. Harris, a CPA who has been overseeing city finances for a decade.
Eventually, the auditor feels certain that the city will no longer be able to pay its bills. At that point, an emergency financial manager will have to be appointed, who will have the power to make all spending decisions. The mayor will then be largely a figurehead.
Desiree Cooper, the city's best columnist, wrote that the mayor's victory happened "the day we locked major segments of the black population into intractable poverty, creating a caste that neither participates in mainstream society nor shares its values."
"It may have been a lot of things," she wrote about Mr. Kilpatrick's win. "But it wasn't a surprise."