BEAT OF A DIFFERENT STRUMMER: Ed Koch, as a student at the Greenwich House Music School, lived life as a maverick.

QUITE A MANE:Ed Koch was actually a fair-haired boy (above) before the Bronx-born future mayor went off to fight in France during World War II.

(AP)

“If you agree with me on nine out of 12 issues, you should vote for me,” Ed Koch liked to say.

“If you agree with me on 12 out of 12 issues,” he’d add, “you should see a psychiatrist.”

Edward Irving Koch packed a lot of agreeing — and disagreeing — into his 88 years.

He outraged friends by switching sides in Democratic club wars when he was unknown, and he infuriated liberal allies by endorsing Republicans like George W. Bush when he was a political icon.

More than once, he was a kingmaker — yet he ruined his own chance to become governor when he trashed people who lived outside New York City.

He made the Rev. Al Sharpton famous by having him arrested on the City Hall steps. He endorsed President Jimmy Carter for re-election when he was a long shot and later revealed how much he despised Carter because of his criticism of Israel

Koch was born in the Crotona Park East section of The Bronx on Dec. 12, 1924, the second of three children of Polish Jewish immigrants. He grew up in Newark and then on Ocean Parkway in Brooklyn.

At 18, while attending City College, he was drafted into the Army. He landed in France as a combat infantryman three months after D-Day in 1944, fought in the Battle of the Bulge and was a sergeant with two battle stars when he was discharged.

He returned to New York to earn a law degree from NYU, passed the bar in 1949 and opened his own law practice — while living with his parents.

Koch was drawn into politics by the doomed presidential campaigns of liberal icon Adlai Stevenson. He and fellow Stevensonians formed a club, the Village Independent Democrats, that challenged the Greenwich Village power base of longtime Tammany Hall boss Carmine DeSapio.

Even then Koch was a maverick. He briefly switched sides to join DeSapio’s club, a heretical move that even he said made him something of a traitor.

During his VID years, he took a few conservative positions, like supporting the death penalty, while championing traditional liberal causes, civil liberties and, of course, rent control. He convinced the VID to vote to censure the city parks commissioner for refusing to issue a speech permit to the American Nazi leader George Lincoln Rockwell.

After Koch and his allies ousted DeSapio as district leader and Manhattan party boss, he won a City Council seat in 1966.

Two years later, the Republican incumbent of the “Silk Stocking” congressional district declined to run for re-election. In an upset, Koch won the seat that had been in GOP hands for 34 years.

He easily won re-election three times— garnering as much as 77 percent of the vote. In Washington, he vied with fellow Manhattanite Bella Abzug for the role of most liberal member of Congress.

Meanwhile, the city went broke. Voters blamed Mayor Abraham Beame. Koch, Abzug and Mario Cuomo challenged Beame in a crowded Democratic mayoral primary in September 1977.

Koch got only 20 percent, and Cuomo got 19 percent — well ahead of Abzug, the favorite — but, in a major surprise, that was enough to qualify for a runoff,

Koch was the underdog again in the runoff but beat Cuomo by 76,000 votes. They faced off one more time when Cuomo ran in the general election on the Liberal Party line, but Koch won easily.

It was during the runoff that allegations of his being gay first gained attention. Koch insisted for years he was heterosexual. But being Koch, he also said, “My answer to questions on this subject is simply, ‘F–k off!’ ”

Critics said Koch, who called himself a “liberal with sanity,” tilted to the right in his first term, when he slashed services while the city was hanging onto its own fiscal cliff.

Although he had gone to Mississippi in 1964 to register black voters, his relations with minority groups soured as mayor, particularly after closing Sydenham Hospital in Harlem and denouncing “poverty pimps.”

Sharpton said he had never been arrested until he and other protesters had a verbal confrontation with the mayor on the steps of City Hall in 1978.

When a few did, he shouted, “Dummies!” The rest of the crowd roared its approval.

No mayor, not even Fiorello La Guardia, attained the level of popularity that Koch did as he basked in the city finally getting back to fiscal health.

He ran on both the Democratic and Republican lines in his 1981 re-election race. His 75 percent of the vote set a mayoral record — which he broke four years later when he got 78 percent.

He reinforced his reputation for political savvy by endorsing President Carter for re-election in 1979, at a time when Carter was considered a long shot to defeat challenger Ted Kennedy.

Even political foes recognized Koch’s proudest moment — when he cheered on New Yorkers who were struggling during the crippling subway- and bus-worker strike in 1980.

“Whatever you thought of the transit strike, nobody can forget the mayor of New York at the Brooklyn Bridge welcoming people walking to work,” veteran Democratic leader Ruth Messinger said yesterday.

And somehow, the tall, prematurely balding guy in a Brooks Brothers suit became a media darling.

Time magazine put him on its cover in 1981. He appeared four times on “Saturday Night Live,” including twice as host. He played himself several times, including in “Barney Miller” on TV and in “The Muppets Take Manhattan” on the big screen.

His 1984 memoir, “Mayor,” became a best seller and was turned into a musical that ran for more than 200 performances at two off-Broadway locations.

Koch’s first election setback since an Assembly race in 1962 came in 1982, when Gov. Hugh Carey declined to run for re-election.

“I had an attack of hubris,” he said of his doomed race against — guess who, Mario Cuomo — in another Democratic primary.

Koch blamed the loss on his mouth. In a Playboy interview before the primary, he trashed life outside a big city.

“Have you ever lived in the suburbs? It’s sterile. It’s nothing. It’s wasting your life,” he said. “Or out in the country, wasting time in a pickup truck when you have to drive 20 miles to buy a gingham dress or a Sears Roebuck suit?”

His ambition to become the city’s first four-term mayor was dealt a body blow in the late 1980s by revelations of a series of corruption scandals involving political allies, including Queens Borough President Donald Manes, who committed suicide.

Koch was surprised and felt “genuinely betrayed” by Manes and others implicated in the unfolding mess, former Deputy Mayor Stanley Brezenoff said yesterday.

He was “totally depressed” as the graft disclosures came out, and it was the low point of his mayoral tenure, recalled Ken Lipper, another former deputy mayor.

Even former Miss America Bess Myerson, whose campaigning with Koch gave him a major boost in his first mayoral race, resigned as his commissioner of cultural affairs amid another scandal.

Koch’s personal reputation for honesty remained unbesmirched. But was he politically vulnerable. In the 1989 Democratic mayoral primary, he was defeated by David Dinkins, who went on to become the city’s first African-American mayor.

It was basically a referendum on Ed Koch. He lost by 90,000 votes.

Brezenoff, who served in all 12 years of the Koch administration, recalled yesterday how in later years, the former mayor would meet passers-by who would say, “We miss you. We want you back.”

“No, you don’t. You voted me out,” Koch replied. “And now you must be punished.”

“I was with him when he did that on several occasions,” Brezenoff said. “And he was only partly joking.”

Unlike most of his predecessors, who glided into anonymous retirement, Koch seemed busier than ever as an ex-mayor.

He replaced Judge Joseph Wapner on TV’s “The People’s Court,” joined a law firm, taught at Brandeis University and became popular on the lecture circuit.

He remained a quintessential New Yorker, arranging to be interred in the only Manhattan cemetery that accepts new burials.