October 31, 2019 | 11:42pm

Donald Trump is leaving New York.

President Trump explained on Thursday night the agonizing decision to ditch Manhattan’s Trump Tower and book it to his Palm Beach resort at the conclusion of his White House tenure.

The Queens native penned a series of tweets about his departure after reports said he filed documents to change his primary residence to 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.”

Then Trump added: “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 on 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.

“I hated having to make this decision,” wrote Trump, who has lived in the skyscraper on Fifth Avenue off 57th Street since 1983.

“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 has pleased him.

“The White House, is the place I have come to love and will stay for, hopefully, another 5 years,” he said.

And no matter what, Trump said he “will always be there to help New York and the great people of New York.”

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