While mayor, he wrote three books including the best-seller "Mayor," ''Politics" and "His Eminence and Hizzoner," written with Cardinal John O'Connor. He wrote seven other nonfiction books, four mystery novels and three children's books after leaving office.
Early in his second term, Koch flip-flopped on his pledge to remain at City Hall and decided to run for governor against then-Lt. Gov. Mario Cuomo. But his 1982 gubernatorial bid blew up after Koch mouthed off about life outside his hometown.
"Have you ever lived in the suburbs?" Koch told an interviewer who asked about a possible move to Albany. "It's sterile. It's nothing. It's wasting your life."
It cost him the race, but it convinced many of the 8 million city residents that Koch belonged in New York. Meanwhile, Cuomo went on to serve three terms as governor.
Koch's third term was beset by corruption scandals. Queens Borough President Donald Manes — a close ally — committed suicide in March 1986, after having resigned over kickback and patronage allegations. Bronx Democratic leader Stanley Friedman and three others were also tarred. Koch's commissioner of cultural affairs, former Miss America Bess Myerson, stepped down in the wake of a scandal involving her boyfriend and a judge overseeing a legal case concerning him.
As the pressure grew, Koch suffered a minor stroke in 1987.
The administration was also beset by racial unrest, first after the 1986 death of a black youth at the hands of a white gang in Howard Beach and three years later after a black teen was shot to death in Brooklyn's tough Bensonhurst neighborhood by a group of whites.
Six weeks after the second slaying, Koch lost the Democratic primary to the city's eventual first black mayor, David Dinkins. Koch later said the simmering racial tensions didn't lead to his defeat.