Former president Donald Trump’s company sued the city of New York on Monday, seeking to reverse the cancellation of Trump’s contract to run a city-owned golf course in the Bronx.

Mayor Bill de Blasio (D) terminated Trump’s contract to run the Ferry Point golf course in January, citing Trump’s role in the Jan. 6 attack on the U.S. Capitol. The city said that Trump had tarnished his brand name such that he could never operate a “first class, tournament quality course” as the city wanted, according to court papers.

In the lawsuit, Trump said the course had done nothing to break its contract with the city. Instead, he said, de Blasio disliked Trump because of his politics and used the Capitol insurrection “as a pretext” to carry out a political vendetta.

City officials “were biased in that they have animosity against President Trump, and they prejudged this case,” Trump’s company said in the lawsuit.

The company asks a New York state judge to reverse de Blasio’s decision and allow Trump to continue operating the city-owned course beyond its scheduled closure in November. The suit was first reported Monday by ABC News.

Nick Paolucci, a spokesman for the city’s Law Department, said that the city believed its actions were proper, and that it still intended to select a new operator for the course.

“The actions of Mr. Trump to incite a deadly riot at the Capitol on January 6th caused a breach of the Ferry Point contract by eliminating options for hosting championship events,” Paolucci said in a written statement. “We will vigorously defend the City’s decision to terminate the contract.”

While he was president, Trump gave control of his business to his sons and executive Allen Weisselberg. It’s unclear how much control Trump has retaken now that he has left office. Monday’s lawsuit was signed by an underling, Ron Lieberman. The company’s official statement was sent out by Trump’s chief legal officer, Alan Garten.

“The City has no right to terminate our contract,” the statement said. “Mayor de Blasio’s actions are purely politically motivated, have no legal merit, and are yet another example of the mayor’s efforts to advance his own partisan agenda and interfere with free enterprise.”

Before Jan. 6, Trump ran three businesses in city parks: a carousel and ice rinks in Central Park and the Ferry Point course in the Bronx. All three contracts were signed before Trump entered politics. Together, the three operations produced between $11 million and $17 million per year in revenue, according to financial disclosures Trump filed as president.

After Jan. 6, de Blasio said he was canceling all three.

“The President incited a rebellion against the United States government that killed five people and threatened to derail the constitutional transfer of power,” de Blasio said then. “The City of New York will not be associated with those unforgivable acts in any shape, way or form.”

In two of the three cases, the real-world impact of de Blasio’s decision was minimal.

Trump’s contracts to run the ice rinks and the carousel were about to expire this year anyway. But the Ferry Point contract was supposed to last into the 2030s.

The course overlooking the East River produced a steady stream of revenue — between $6 million and $8 million a year, although the profits were much less. The Trump Organization had just finished upgrading it, adding a clubhouse, restaurant and large pro shop.

The city said Trump had violated his obligation to run a “tournament-quality course” after his actions on Jan. 6 — which included telling supporters to “fight like hell” to overturn an election he had “won in a landslide” — caused the organizers of both the PGA Championship and the British Open golf tournaments to say they would not hold events at Trump clubs.

“The obligation to operate a course capable of attracting professional tournament quality events by the PGA or similar organizations has been breached,” the city said, according to Trump’s lawsuit.

Trump is disputing that finding, saying that the tournament-quality standard was meant to describe the course itself, not his brand name. To counter the city’s allegations, Trump’s lawsuit includes testimonials from several pro golfers and golf magazines, praising the course as a place to play.

In the suit, Trump concedes the city does have a right to terminate the contract “at will,” without proving that he breached the contract. But that option would be a costly one for the city. If the city wants to kick Trump out that way, the lawsuit says, it would owe his company $30 million to reimburse it for the improvements made to the course.