The primaries for the mayoral race took place on 9/11/2001, but were postponed after the attacks. He later beat the Republican challenger in the rescheduled primary.
Bloomberg set a new campaign spending record for the mayoral race in New York City, when he spent $74 million. He eventually won over the traumatized New York City population, and took the mayoral race in late 2001 by a margin of 2%.
Bloomberg stepped down as CEO of his company, and appointed Lex Stanwick as the new CEO.
He was inaugurated mayor in January of 2002, accepting just a salary of just $1/year.
Source: encyclopedia.com, nyc.gov, Bloomberg