NEW YORK (AP) — Ed Koch couldn't have chosen a more appropriate final farewell to New York City.
An organist played "New York, New York," the iconic ballad made famous by Frank Sinatra, in a Manhattan synagogue Monday as the former mayor's oak coffin was carried past thousands of mourners, concluding a funeral that recalled the quintessential New Yorker's famous one-liners and amusing antics in the public eye.
Koch died Friday of congestive heart failure at age 88.
After the funeral, Mayor Michael Bloomberg and former Mayors Rudolph Giuliani and David Dinkins held their hands to theirs hearts. Police helicopters flew overhead and bagpipes wailed on the freezing February afternoon.
Recalling Koch as "brash and irreverent," Bloomberg told the crowd that came to pay its respects that the man who steered the city through the 1970s and 1980s must be "beaming" from all the attention created by his death.
"No mayor, I think, has ever embodied the spirit of New York City like he did," Bloomberg said. "And I don't think anyone ever will."
True to his take-charge nature, Koch even choreographed his own funeral. Aware of his impending mortality during his final days, Koch wanted to know everything about the particulars of the event, said Diane Coffey, his former chief of staff.
Coffey said her old boss was grateful when she told him last week that Bloomberg was planning to speak at the service. She said he would have been "over the moon" that former President Bill Clinton also spoke.
Coffey said Koch insisted upon being buried in a cemetery "conveniently located near a subway stop" so that New Yorkers could come and visit his grave.
"We began talking about his death in the '80s and his plans for it," Coffey said. "Who else plans every detail of a burial?"
The packed crowd broke into a spontaneous standing ovation as the coffin made its way out of the synagogue. Koch will be buried at the Trinity Church cemetery in Manhattan's Washington Heights neighborhood.
His tombstone says he "fiercely" defended New York City and loved its people and America.
"We had such respect for him because of his outsized personality," Bloomberg told the crowd. "Matched by his integrity, his intelligence and his independence."
Koch led the city for 12 years with a brash, humor-tinged style that came to personify the New York of the 1980s.
The Democratic mayor is credited with helping save New York from its economic crisis in the 1970s and leading it to financial rebirth. But during his three terms as mayor, he also faced racial tensions and corruption among political allies, as well as the AIDS epidemic, homelessness and urban crime.
Bloomberg noted that the funeral was being held near "a certain East River span" — referring to the 59th Street bridge, which was renamed the Ed Koch Queensboro Bridge in 2011.
Describing the bridge dedication ceremony, Bloomberg drew laughter from the crowd as he recalled Koch stood there for 20 minutes, yelling: "Welcome to my bridge!"
Noah Thaler, Koch's grand-nephew, praised him as a "doting grandfather" who was devoted to his family. Thaler recalled fond memories of Koch attending elementary school soccer games and getting a manicure with his 11-year-old grand-niece.
"While he knew he was often portrayed as a lonely bachelor, it didn't matter," Thaler said. "He saw in his family only perfection."
Clinton, who represented President Barack Obama at the funeral, addressed Koch and said the world was "doing a lot better because you lived and served."
"He had a big brain," Clinton said of the late mayor. "But he had a bigger heart."
Clinton said he was also speaking for his wife, former Secretary of State Hillary Rodham Clinton, "who loved him very much and was grateful for his endorsement in every race."
The funeral was held at Temple Emanu-El, one of the nation's most prominent synagogues, a Reform Jewish congregation on Fifth Avenue across from the Central Park Zoo. Bloomberg is a member, as are comedian Joan Rivers and former New York Gov. Eliot Spitzer.
"I don't want to leave Manhattan, even when I'm gone," Koch told The Associated Press in 2008 after purchasing a burial plot in Trinity Church Cemetery, at the time the only graveyard in Manhattan that still had space. "This is my home. The thought of having to go to New Jersey was so distressing to me."
Parts of the funeral were in Hebrew. Ido Aharoni, Israel's consul general, praised Koch's fervent support for Israel and called him "one of the most important and influential American Zionists of our time."
In another tribute to Koch, U.S. Rep. Carolyn Maloney plans to recommend that the subway station at East 77th Street and Lexington Avenue be named in his honor.
Koch lost the Democratic nomination for mayor in 1989 to Dinkins, but he maintained that he was defeated "because of longevity." As he put it: "people get tired of you."
But as the votes were coming in, he said he told himself, "I'm free at last."
James Gill, who was Koch's law partner, recalled Monday that after Koch was denied a fourth term, New Yorkers would often come up to him on the street and suggest he go back to running the city. But the former mayor, Gill said, would answer: "No. The people threw me out and now the people must be punished."
Associated Press Writer Verena Dobnik contributed to this report.