UNDATED (CNN) -- Former New York City Mayor Ed Koch has died. He passed away overnight in a New York Hospital of congestive heart failure. He was 88. Koch served three terms as mayor, beginning with his election in 1977.
He occupied City Hall for 12 years, but never stopped asking New Yorkers if he deserved to be there.
Ed Koch did well enough to be elected to three terms and was never afraid to do and say what he wanted. He said, "I have a wonderful job as mayor. I intend to keep it for a long time."
Kock won his first term in 1977 at a time when the city was bankrupt. He says, "When I came in, the potholes were enormous, the trains, the subways had graffiti, crime was rampant."
He led the city back to financial solvency. But he did more than that, he gave New York "attitude."
During a subway and bus strike, Koch personally arranged other ways for people to commute. He was brash, candid, and proud. He said, "I brought a spirit back to the city of New York that was absent, because New Yorkers were ashamed of living here because of what prior administrations had done."
Edward Koch was born in the Bronx in 1924. He was the son of Polish-Jewish Immigrants who had a fur shop that went bust during the Great Depression. As a kid, Ed worked as coat checker and in high school as a deli clerk.
College was interrupted by World War II. Koch joined the Army and was a decorated combat veteran in Europe. Back home, he went to NYU Law School and became an attorney.
Koch's political career began in Greenwich Village getting elected to the city council in 1966 and then four terms in the U.S. Congress.
Koch won his second term as mayor in 1981, but ran for governor the next year. He lost the Democratic primary to rival Mario Cuomo, whom he'd beaten before to win the mayoralty.
As mayor, Koch launched an "affordable" housing plan that he considered his greatest accomplishment. It eventually added 100,000 new apartments and restored 150,000 for lower income and homeless New Yorkers.
He received a record 75 percent of the vote in 1985 to win a third term. His autobiography became a best-seller and then an off-Broadway musical.}
But Koch gradually lost support. Racial tensions mounted, symbolized by the attacks on black men by whites in the Queens neighborhood of Howard Beach and the Brooklyn neighborhood of Bensonhurst. And corruption was exposed involving Koch's friends and political allies.
Koch was also hospitalized with a mild stroke. In 1989, he ran for a fourth term, but lost the Democratic primary to Manhattan borough president David Dinkins, who would become the city's first black mayor. He said at the time, "I want you not to feel sorry for me. Believe me, there is a life after the mayoralty."
Koch's life continued playing out in public by acting as the judge on "The People's Court", hosting a radio talk show, and writing newspaper columns.
In 1992, some supporters asked him to run for mayor again. He said, "I said, no, The people threw me out and now the people must be punished."
Koch returned to the hospital over the years, suffering a heart attack and receiving a pacemaker. And though he never held office again, his political opinions were frequently sought and heard.
He called successor Rudy Giuliani "a nasty man," but liked Mayor Mike Bloomberg. He said about Bloomberg, "He is Mister New York!"
As he entered his 80's, Koch had his strong admirers and detractors. But nobody ever accused of him not loving the city he ran for 12 years. He said, "As I walk around people will yell at [me] -- it's really wonderful -- they'll yell, "Don't ask, you're doing terrific!" So I am very proud of what I did and happy that I was given the opportunity by the people to serve."