A Florida golf course owned by President Donald Trump has been ordered to immediately pay $5.77 million to former members who were denied refunds when the real estate mogul bought the club five years ago.

U.S. District Judge Kenneth Marra ruled that Trump National Golf Club in Jupiter violated contracts that members had signed with the previous owner and were assumed by Trump when he bought the club in 2012. The average payment is expected be about $87,000 for each of the 65 members involved in the case. The members were awarded $4.8 million, plus $925,000 in interest.

Members complained during an August trial that Trump had ripped them off and that they had lost millions of dollars, the Palm Beach Post reported.

Trump purchased the club from Ritz-Carlton for $5 million ― which was below market value ― with the understanding that he would honor up to $41 million in refundable membership deposits, according to testimony and documents presented in court, the Post reported.

Under Ritz-Carlton rules, people had to join waiting lists if they wanted to cash in their memberships and leave. They would have to pay dues until they left, but could also continue to enjoy the benefits of membership. Under Trump rules, members waiting to leave still had to pay dues but could no longer access to the club.

“We are committed to seeing Trump National Golf Club Jupiter on the list of the best clubs in the world, and if you choose to remain on the resignation list, you’re out,” Trump wrote to members in December 2013, according to CNNMoney.

Trump’s son Eric, who ran the club, said during a testimony that being forced to pay dues without having access to the club “would violate a fundamental principle,” the Associated Press reported. Trump, who was campaigning for president during the trial, testified via video.

The Trump Organization plans to appeal. “The club was suffering financially making it unlikely that these members would ever get back their deposits,” an organization spokesman said in a statement about the state of the club when Trump purchased it.

The Jupiter club is one of a number of Trump’s golf courses entangled in problems. The PGA Tour moved an event from his Miami course to Mexico last summer, after the event couldn’t raise sponsorship funds. Trump is suing the town of Ossining, New York, in an effort to lower the taxes on his golf course there. The town has valued the course at $15.1 million, but Trump insists it’s worth only $1.5 million.

And locals of Aberdeen, Scotland, are generally furious about Trump’s course there, which he opened in 2012. Although he promised people in the town that they would get rich on property sales and that the community would reap taxes, that hasn’t been the case. Trump hasn’t paid any taxes due to losses on the courses. He also harangued officials and launched a court battle over Scottish plans to build environment-protecting offshore wind farms, but lost.

Golf courses are hardly Trump’s only business problems. He also agreed in November to pay $25 million in fines and restitution to settle three fraud lawsuits filed by former customers of Trump University.