NEW YORK - Edward Koch, the master showman of City Hall, who parlayed shrewd political instincts and plenty of chutzpah into three tumultuous terms as mayor of New York with all the tenacity, zest and combativeness that personified his city of golden dreams, died Friday at age 88.

His spokesman, George Arzt, said Koch died from congestive heart failure after carefully arranging to be buried in Manhattan because, as he explained: "I don't want to leave Manhattan, even when I'm gone. This is my home. The thought of having to go to New Jersey was so distressing to me."

Koch had experienced coronary and other medical problems since leaving office in 1989. But he had been in relatively good health amid his whirlwind life as a television judge, radio talk-show host, author, law partner, newspaper columnist, movie reviewer, professor, commercial pitchman and political gadfly. Only his bouts of illness slowed him down, most recently forcing him to miss the premiere on Tuesday of "Koch," a documentary biographical film that opens Friday in theaters nationwide.

Mayor Michael Bloomberg praised Koch as "an irrepressible icon, our most charismatic cheerleader and champion," calling him "a great mayor, a great man, and a great friend." He saluted Koch as "a civic savior for our city in desperate times," saying "the whole city was crumbling" when Koch was elected.

Koch's 12-year mayoralty encompassed the fiscal austerity of the late 1970s and the racial conflicts and municipal corruption scandals of the 1980s, an era of almost continuous discord that found Koch caught in a maelstrom day after day. But he was a feisty egoist who could not be pinned down by questioners and who could outtalk anybody in the authentic voice of New York.

"I'm the sort of person who will never get ulcers," the mayor -- eyebrows devilishly up -- told reporters at his $475 rent-controlled apartment in Greenwich Village on Inauguration Day in 1978. "Why? Because I say exactly what I think. I'm the sort of person who might give other people ulcers."

But his mouth also got him into trouble, costing him his 1982 bid for governor. "Have you ever lived in the suburbs?" Koch said about a possible move to Albany. "It's sterile. It's nothing. It's wasting your life." He said life in the country meant having to "drive 20 miles to buy a gingham dress or a Sears, Roebuck suit."

His political odyssey took him from independent-minded liberal to pragmatic conservative, from street-corner hustings with a little band of reform Democrats in Greenwich Village to the pinnacle of power as New York City's 105th mayor from Jan. 1, 1978, to Dec. 31, 1989. Along the way, he served two years as a councilman and nine more in Congress. With his trademark -- "How'm I doin?" -- Koch stood at subway entrances on countless mornings wringing the hands and votes of constituents, who elected him 21 times in 26 years. But New Yorkers eventually tired of Koch. Homelessness and AIDS soared in the 1980s, and critics charged that City Hall's response was too little, too late.

Edward Irving Koch was born in the Bronx on Dec. 12, 1924, the second of three children of Louis and Joyce Silpe Koch, Polish Jews who had immigrated to New York in the early 1900s. He worked his way through school, checking hats, working behind a delicatessen counter and selling shoes. He was drafted into the Army in 1943 and earned two battle stars in Europe as an infantryman.

Koch, who never married, wrote 17 books. He played himself in the movies "The Muppets Take Manhattan" and "The First Wives Club" and hosted "Saturday Night Live." In 1989's "Batman," Gotham City's mayor bore a definite resemblance to Koch.

At 83, he paid $20,000 for a burial plot at Trinity Church Cemetery, at the time the only graveyard in Manhattan that still had space. He had his tombstone inscribed with the last words of Daniel Pearl, the Wall Street Journal reporter beheaded by Islamic militants: "My father is Jewish, my mother is Jewish, I am Jewish."

Koch is survived by New York itself, as a friend put it a few years ago. Maureen Connelly, a former press secretary, said: "The city was and is his family."

The Associated Press contributed to this report.