He would put party aside and do what was best for New York. That was how Mayor Ed Koch, a lifelong Democrat, defended his decision to invite two Republican candidates — Ronald Reagan and Al D’Amato — to Gracie Mansion in October 1980, just weeks before Election Day.

The move infuriated President Jimmy Carter and many other Dems, but Koch was firm. Saying later he had “established a good relationship” with Reagan, he added, “I’m trying to run this city in a nonpartisan or bipartisan way in the sense that I want to run it as a first-rate business.”

After Reagan was elected, Koch even invited the president and Nancy Reagan to stay at Gracie Mansion any time they were in New York.

Oh, for those days of principled ­bipartisanship.

Now, despite having a New Yorker in the White House for the first time since FDR, city and state Democrats won’t give President Trump the time of day. They use their enormous power to harass and investigate him, putting politics ahead of what’s good for the people they ­ostensibly represent.

New York is paying a high price for their partisan games.

Instead of reaping a bonanza of federal dollars for big-ticket items such as the Gateway tunnel rail project, New York has gotten nothing, bupkis, zero by way of special treatment. Talk about a wasted opportunity — and for what?

For headlines and street cred among the crazies who believe Trump is an illegitimate president, that’s what.

In Albany, the Legislature passed and Gov. Andrew Cuomo signed a bill authorizing the state to give Trump’s tax returns to Congress. Cuomo, who personally lobbied Trump to fund the Gateway program and later accused him of “political retaliation” when the feds downgraded the project’s importance, apparently has ­decided that playing politics is more important than trying to reverse the fed decision.

If the project is as vital as he says, maybe the governor should try sugar with the president instead of vinegar.

Similarly, New York Congressman Jerry Nadler, chairman of the House Judiciary Committee, doesn’t try to hide the fact that he is determined to impeach the president. Nadler, in Congress since 1992, has sent out a new raft of subpoenas to Trump’s business and family associates in a desperate hunt to find a rationale for a decision he’s already made.

The state attorney general, Letitia James, campaigned on a platform of using her powers to go after the president. And the state’s two US senators, one of them Senate Minority Leader Chuck Schumer, have done nothing except attack the president for more than two years.

Even when Trump takes a position they once held, they flip-flop just to disagree with him. Recall that Schumer opposed the nuclear deal with Iran made by President Barack Obama, but when Trump pulled out of it, Schumer defended the deal and criticized Trump. Huh?

Democrats can’t say they weren’t warned about the cost of going down this dirty road. Last November, the day after the midterm elections in which Dems won control of the House, Trump praised Speaker Nancy Pelosi and said he hoped the parties could work together on infrastructure, immigration, drug pricing and other issues.

“There are many things we can get along on without a lot of trouble — that we agree very much with them and they agree with us. I would like to see bipartisanship,” Trump said.

But when asked if cooperation could survive if Dems used their new power to demand his tax returns and paper the White House with subpoenas, Trump answered without hesitation: “No. If they do that, then it’s just — all it is, is a warlike posture.”

And so war it is. A dumb, destructive war at that.

As for Koch, he fiercely criticized Carter over the president’s pro-Arab, anti-Israel stance at the United Nations, and argued that Carter’s domestic policies gave the city budget help with one hand and took it away with the other.

Koch’s appearance with Reagan and D’Amato surely helped them, as Reagan carried New York state over Carter by 165,000 votes and D’Amato was elected to the Senate.

Most important, the mayor’s welcome mat to the other party turned out to be good for the city. Koch said that Reagan promised — and delivered on — several major budget items, including fast approval of $600 million in remaining federal loan guarantees and the removal of costly mandates covering everything from handicapped children to sludge removal.

Years later, Koch surprised me by saying he had actually voted for Carter. “I’m a loyal Democrat,” he said matter-of-factly, illustrating that his 1980 appearance with Reagan really was about putting the city first.

New York needs some Democrats like him today.

AP’s anti-Trump bias ‘Bubbas’ to the surface

The Associated Press isn’t subtle with its bias. Under the headline, “What did Jeffrey Epstein’s famous friends know and see?,” it runs a picture of Trump and Labor Secretary Alex Acosta.

Apparently, no pictures of Bill Clinton were available.

Holding these truths

Secretary of State Mike Pompeo, writing in the Wall Street Journal, announced he is forming a Commission on Unalienable Rights, an innovative idea at a time when the word “rights” is used more for grievance purposes than to describe genuine liberty.

As Pompeo put it, “Human-rights advocacy has lost its bearings and become more of an industry than a moral compass. And ‘rights talk’ has become a constant element of our domestic political discourse, without any serious effort to distinguish what rights mean and where they come from.”

His point, of course, stems from the Declaration of Independence, which says, “We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness . . .”

Pompeo’s idea takes on added importance because of the failure of large swaths of our education system. The study of American history and civics prepared generations of students to become good citizens, but these days, many things considered pro-American are being whitewashed from textbooks, lest we offend those who hate America.

A federal commission can’t by itself fix that nonsense. But, if done right, it can spread a broader understanding of God-given rights, and why the concept helped make America the exceptional nation it is.

Surrogate Sarah

Reader Carole Campolo has a theory about the vicious media attacks on Sarah Huckabee Sanders, who resigned recently as Trump’s press secretary.

“The abuse of Ms. Sanders is horrific,” Campolo writes. “But I believe she is just a conduit for the media’s hate of we Trump supporters. Since it is not possible to take out their rage against some 63 million voters individually, the media pick a surrogate, and with their Alinsky tactics, isolate it, freeze it and try to destroy it.

“Sanders is us and we are Sanders. That is perhaps the most chilling outcome of this mania.”