The owner of a Brooklyn, NY, assisted living building will pay its five remaining residents $533,333 each to vacate the premises by Aug. 31 and also will pay the estates of 11 former residents.

The owner of Prospect Park Residence will pay a total of $3.35 million in a deal reached May 31 in Kings County Supreme Court.

The agreement comes after a two-year court battle that followed Haysha Deitsch’s 2014 decision to sell Prospect Park to a real estate investment company that planned to convert the units into luxury condominiums. Two months after the intended sale was announced, residents were given 90 days to move, and some of them went to court to prevent the building’s closure. Residents accused Deitsch of refusing to turn on the air conditioning, dimming hallway lights, providing meager meal plans and keeping the facility understaffed in an attempt to get them to leave. In July 2015, a judge threw out a motion to dismiss their case.

In March of this year, Deitsch sued the adult children of the remaining residents for $50 million because they would not move their parents. He still faces additional lawsuits related to the building’s sale and alleged wrongful deaths. 

Deborah Fassor, a spokeswoman for the facility, told the New York Daily News that the building was forced to cease operations due to financial losses and increasing tax burdens.

At one point, the building housed more than 100 older adults. The five residents who remain all are aged more than 91 years.