Editor's note: Charles Kaiser is the author of "1968 In America" and "The Gay Metropolis," a former reporter for The New York Times and The Wall Street Journal, and a former press critic for Newsweek.
(CNN) -- He revered friendship; he loved food, and Israel, and gay people, and he adored New York City. He also loved himself.
When Edward Irving Koch died early Friday morning in a New York hospital at age 88, it had been almost a quarter of a century since he had left office. But he never faded away. He stayed relevant until his last breath, and he had kept the ear of every important Democrat, from Barack Obama to the lowliest city councilman.
As much as his hero, Fiorello LaGuardia -- and more than any other politician -- he embodied New York City in the 20th century.
Eighteen months ago, after he supported a Republican in a special election for Congress to express his unhappiness over Obama's position on Israel, the president summoned him to a meeting -- and Koch responded by immediately endorsing the president for re-election after they had met.
I first met Koch in 1977 when I was a young political reporter for The New York Times, and I covered him for two years after he went to City Hall in 1978. A couple of years later, I wrote a negative review of a biography that was critical of him, and that cemented our friendship. This led to many meals at Gracie Mansion and at my apartment.
When he took office, the city was a violent place, teetering on the edge of bankruptcy, and he and New York Gov. Hugh Carey did more than anyone else to revive it. "In terms of beating the drums and keeping people awake and having people hope that the city would make it, no one was more important," Felix Rohatyn told me. Rohatyn is the investment banker who played a crucial role in fashioning the solutions that brought the city back from the brink..
Koch liked to say, "I'm just a simple Jewish boy from the Bronx," and he never forgot where he came from. As a teenager Koch worked as a waiter, and the first time he came to dinner at my apartment, he was shocked when he saw how much I was cutting off the strawberries I was serving him for dessert. "You're wasting a lot!" he said.
Unlike so many other politicians who never discussed sexual orientation in public, Koch had the longest and strongest pro-gay rights record of any public official of his generation, dating all the way back to 1962, when he first called for the repeal of the New York state law prohibiting sodomy.
Almost his first official action as mayor was to sign an executive order banning discrimination against gay employees of New York City, an act that dismayed almost every reporter who was covering him, except me.
Tweeters loved Koch's 'New York-iness'
When the AIDS crisis struck at the beginning of his second term, he reacted much too slowly, and he told me he regretted that for the rest of his life. But I never saw any evidence that his failure to act was because he was uncomfortable with homosexuality. When Larry Kramer founded ACT UP and accused Koch of killing most of his friends, the mayor wanted to meet with him, but he was dissuaded by his staff from doing so. "I wish I hadn't listened to my staff," Koch told me many years later.
Although he had never managed anything larger than a congressman's office when he became mayor, he turned out to be a superb manager. At the beginning of his administration, he ignored the recommendation of his search committee and picked Robert McGuire, a former federal prosecutor, to be his first police commissioner. It was an inspired choice, and McGuire did a brilliant job, but first he had to convince Koch he was up to the challenge.
"We had a great interview," McGuire recalled. "And he called me that night and said, I really want to give you the job, but you've never managed anything."
McGuire replied, "Ed, you worry about me running the police department. You're going to be running the city of New York and you don't have a clue of what you're going to be doing!"
"I never thought of it that way," Koch replied, and then he gave McGuire the job.
"We never had a disagreement in six years," said McGuire. "As a human being he was a great boss. You have to trust a guy, and you have to let them do their job. Then you have to back them up when they get into deep water, and Ed did all that. And whenever I told Koch that someone had asked me for a political favor, he said, 'Tell them to forget it!'"
One afternoon, many years after he had left City Hall and long after I was reporting on him, I received a frantic phone call from a family friend. Her son had been scheduled to drive her to the airport that morning, and he hadn't shown up. "I'm sure he's in his apartment, but the police won't break down his door," she said.
I hung up and called Koch to explain the situation. He immediately called the office of William Bratton, who was then the police commissioner. Twenty minutes later, the police broke into the apartment of my friend's son, and discovered he had overdosed on heroine. He was in a coma for a week, but then he had a full recovery.
Koch never asked for any thanks.
Most of the time Koch was a natural dealing with the press. When I was writing a profile of Manhattan District Attorney Robert Morgenthau for the Times, I went to City Hall to interview Koch about him, because they had been close political allies for many years.
"People say Morgenthau is a great friend but a terrible enemy," I said to the mayor.
"So am I," said Koch. "And I've given you your kicker!" -- meaning the last sentence of my story.
And so he had.
Follow us on Twitter @CNNOpinion.
Join us on Facebook/CNNOpinion.
The opinions expressed in this commentary are solely those of Charles Kaiser.