Some of the neighbors don’t want him around.

But former president Donald Trump just found a big ally in his quest to call his Florida club, Mar-a-Lago, home during his post-presidency.

According to a memorandum obtained by The Washington Post, an attorney for the town of Palm Beach is recommending that the town’s council allow Trump to live at the club, even though he signed an agreement in the early 1990s changing the property from a residence to a private club. If the council follows the town attorney’s advice, it would be a blow to a loosely affiliated group of neighbors, preservationists and attorneys who have argued that Trump is prohibited from living at the iconic, nearly century-old estate that he had referred to as his “winter White House.”

The memo represents the first time that a town official has formally weighed in on a nettlesome issue that has threatened to complicate Trump’s ex-presidency. The legal opinion is the latest step in a year-long dispute that could force a decision by town officials who have been reluctant to take a formal position. Trump’s Mar-a-Lago residency could be raised before the town council at its two-day meeting next week, possibly as soon as Tuesday — the same day Trump’s Senate impeachment trial begins in Washington.

In his legal opinion, town attorney John C. Randolph argues that the former president should be allowed to use Mar-a-Lago as his residence even though Trump, through his then-attorney, had promised the council in 1993 that he would not live there.

Before approving the agreement, the town council wanted to know whether he would reside there. “The answer is ‘No,’ ” Trump’s then-attorney, Paul Rampell said, “except that he will be a member of the club and would be entitled to use its guest rooms.” The agreement that Trump signed banned club members from staying in guest suites for more than 21 days a year.

The Post’s Carol D. Leonnig explains the difficulties President Trump will have if he claims Mar-a-Lago in Palm Beach, Fla., as his post-presidency residence. (The Washington Post)

The town attorney is now arguing that Trump’s promise essentially is meaningless because there is nothing in his agreement converting the property to a private club that specifically bans him from living at the club.

Behind the scenes, according to documents obtained by The Post, Trump has been urging the town to let him live at Mar-a-Lago.

Those documents show that the legal opinion written by the town’s attorney matches the reasoning in a letter sent late last month to the town by Trump’s current attorney, John B. Marion. Like Randolph, Marion argues that Trump is not bound by the promise he made to the council in 1993. “Nothing that may have been said by” Trump before the 1993 agreement was signed “is relevant,” Marion wrote in a letter to Randolph.

Both Trump’s attorney and the town’s attorney are taking the position that Palm Beach’s zoning codes allow for employees to live at private clubs. Trump is the president of a corporation, Mar-a-Lago LLC, that owns the club, which makes him a “bona fide employee,” according to the letter from Marion that has not yet been made public. Trump’s attorney also asserts that the former president uses an “Owner’s suite,” rather than a “guest suite.”

Randolph states in his memo to the council that “absent a specific restriction prohibiting former president Trump from residing at the Club, it appears the Zoning Code permits him to reside at the Club.”

Town Manager Kirk Blouin did not respond to an interview request.

The controversy tracks back to the early 1990s when Trump was living at Mar-a-Lago. The cost of upkeep was soaring, and he floated a plan to subdivide the property, which he’d bought from the estate of cereal heiress Marjorie Meriweather Post, into more than a dozen housing lots.

The town objected, so Trump sued. Later, he dropped the lawsuit and signed an agreement with the town — called a “use agreement” — that allowed him to repurpose Mar-a-Lago as a private club. Trump also deeded development rights to the property to the National Trust for Historic Preservation. As part of the National Trust deal, Trump agreed to “forever” relinquish his rights to develop Mar-a-Lago or to use it for “any purpose other than club use.”

Trump opponents in Palm Beach have argued that those two agreements mean Trump cannot live at the club. They’ve also attempted to block Trump from circumventing parts of his agreement with the town. In May, Trump withdrew a request to build a dock at Mar-a-Lago after a Washington Post article noted that he was banned from building a dock under the provisions of his agreement converting the property to a private club. Some neighbors have opposed a dock because they fear the arrival of rowdy party boats.

Trump has changed his official residence to the Mar-a-Lago address. He also is registered to vote at the address, prompting complaints from neighbors who said he did not have the right to use Mar-a-Lago as his home.

The controversy intensified in the final days of Trump’s presidency and has been simmering since he left office and flew to Mar-a-Lago, where he has been ensconced since Joe Biden was inaugurated as his successor.

In mid-December, Reginald Stambaugh, an attorney for two Mar-a-Lago neighbors, filed a demand letter asking the town of Palm Beach to block Trump from living at the club. The request urged the town to avoid “an embarrassing situation” if the former president would have to be ordered to vacate.