Edward Irving Koch was born in Crotona Park East 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 separately in the early 1900s. Louis was a furrier and a partner in a shop until it folded in the Depression in 1931. He was drafted into the wartime Army in 1943 and earned two battle stars in Europe as an infantryman. After V-E Day, because he could speak German, he was sent to Bavaria to help remove Nazi public officials from their jobs and find non-Nazis to take their place. He was a sergeant when discharged in 1946. After the war, he moved back in with his parents but did not return to undergraduate studies. (City College awarded him a bachelor’s degree in 1981.) Instead, he went to law school at New York University. He received his law degree in 1948, was admitted to the bar in 1949 and over the next 20 years practiced law in New York City, becoming a founding partner of Koch, Lankenau, Schwartz & Kovner in 1963. Heading a growing reform movement, Mr. Koch won a City Council seat in 1966 and befriended liberal causes, like antipoverty programs and rent controls. By 1968, he was ready to move up. An opponent of the Vietnam War and a supporter of Senator Eugene J. McCarthy’s presidential candidacy, Mr. Koch, with Democratic and Liberal backing, upset Whitney North Seymour Jr. in what was called a classic American race — a son of immigrants versus the scion of a family rooted in national history — and became representative for the 17th Congressional District, the first Democrat to occupy the seat since 1934. The seat, representing the affluent Upper East Side, parts of Midtown and Greenwich Village, was held by John V. Lindsay until he became mayor in 1966. Mr. Koch later represented the 18th District after a redistricting. Mr. Koch, in Congress from 1969 to 1977, became known as a hard-working, independent liberal able to work with conservatives. He was re-elected to the House four times by majorities of 62 percent to 77 percent. Still, he was almost unknown outside his district when he ran for mayor in 1977. Mr. Koch appeared often in the 1977 race with his close friend and adviser Bess Myerson, a former Miss America and a popular former city commissioner of consumer affairs. After winning his second term, Mr. Koch ran for the Democratic nomination for governor. He supported the losing Democratic ticket of Al Gore and Joseph I. Lieberman in 2000, but joined the Bush-Cheney re-election bandwagon in 2004. In 2008, approaching 84, he was still pitching — endorsing Barack Obama for president. Mr. Koch and his sister, Pat Koch Thaler, wrote “Eddie: Harold’s Little Brother,” a children’s book that appeared in 2004. His brother, Harold M. Koch, a carpet distributor, died in 1995. Besides his sister, a former dean at N.Y.U. whom he saw regularly in later years, Mr. Koch is survived by New York itself, as an old friend put it a few years ago.