Donald Trump is leaving New York.

President Trump on Thursday night explained his decision to ditch the glitzy world of Midtown skyscrapers and — eventually — flee to his Mar-a-Lago resort at the conclusion of his White House tenure.

The Queens native penned a series of tweets about his departure from Trump Tower after reports said he filed documents to change his primary residence to Palm Beach, Florida.

“I cherish New York, and the people of New York, and always will,” Trump wrote.

“But unfortunately, despite the fact that I pay millions of dollars in city, state and local taxes each year, I have been treated very badly by the political leaders of both the city and state.”

This would mean the end of a storybook romance between the real estate mogul and the Big Apple.

Trump, who was raised in a modest Tudor-style home, has lived in a gilded 58-floor apartment building emblazoned with his family name on Fifth Avenue since 1983.

The former reality television host featured the Manhattan skyline in his popular game show in the ’00s. He has graced the pages of Gotham’s tabloids for decades.

But, as Trump tweeted, “few have been treated worse.”

Perhaps he was referring to the demonstrators who post up outside Trump Tower when he’s in town.

Or maybe he was thinking of Manhattan District Attorney Cyrus Vance Jr.’s quest to hunt down his tax returns.

How about the city’s new top lawyer, Jim Johnson — who declared Thursday that his No. 1 priority would be going after Trump.

“The city and nation are facing a president that’s just tough on the most vulnerable and one of the things the department has been doing and I would like to advance is focusing on affirmative litigation,” Johnson said.

The city and state also have been battling with the Trump administration over immigration policies and other issues.

“Good riddance,” Gov. Andrew Cuomo said after news broke of Trump’s impending exit. “He’s all yours, Florida.”

For Trump, the resolution was not an easy one.

“I hated having to make this decision,” he wrote. “But in the end it will be best for all concerned.”

Despite the residence change — which was filed in late September — Trump said Pennsylvania Avenue suits him well.

“The White House, is the place I have come to love and will stay for, hopefully, another 5 years,” he said, referring to a second term in the Oval Office.

And no matter what, Trump promised he “will always be there to help New York and the great people of New York” — the financial and cultural mecca that helped create him.

“It will always have a special place in my heart!”