He entered the race in June, three months before the Republican primary, appearing so stiff at an introductory news conference that a reporter had to instruct him on how to proceed. “That’s not going to stop, no matter what I do?” Mr. Bloomberg asked anxiously as cameras clicked.

He never much improved as a candidate. By January, he was mayor anyway.

Nearly two decades later, as Mr. Bloomberg plots an unconventional path to the Democratic presidential nomination, allies see his first mayoral run as proof of concept. It was the race that demonstrated, both to Mr. Bloomberg and to those who might doubt him, that an inelegant campaigner with bottomless resources, party agnosticism and a heap of political baggage could prevail.

Then as now, he was prepared to spend whatever it took — some $70 million in 2001, a figure he is expected to greatly surpass in 2020 — to boost his name and bury his opponents. Then as now, those urging him to reconsider were brushed aside, overruled by a man at once fanatical about data-driven decision-making and secure in the knowledge that statistical unlikelihood had never stopped him before.

Yet a review of the 2001 race, drawn from dozens of interviews with aides, advisers and adversaries, makes plain that Mr. Bloomberg’s political origin story owes to almost supernaturally improbable conditions — a blend of searing tragedy, canny check-writing and a string of flukes so politically fortuitous that his Democratic rival began wondering if the New York Yankees were conspiring against him. (The team’s World Series appearance that fall, stretching a full seven games and extending into November for the first time in history, allowed Mr. Bloomberg’s final advertising blitz to air before an outsize local audience just before Election Day.)

By far most significant, the shock of the Sept. 11 attacks conferred instant resonance upon Mr. Bloomberg’s message of steady-handed management, which had stirred limited enthusiasm initially. “On September 10th, 2001, the city was doing well. There was no compelling need for an outsider,” said Edward Skyler, a campaign aide in 2001 who became one of Mr. Bloomberg’s deputy mayors. “A career politician would do fine on September 10th.”