WARREN, Maine — After losing a round in federal court that could open the town to damages of more than $4 million, the community has been ordered to participate in a settlement conference with the firm that was barred from opening a methadone clinic here.

The conference has been scheduled for May 22 in U.S. District Court before U.S. Magistrate Judge John Nivison. The order states that both parties should be prepared to engage in effective settlement negotiations.

The order for a settlement conference comes two weeks after another federal magistrate concluded in his recommended ruling that Warren’s ordinance regulating methadone clinics was discriminatory and violated the federal Americans with Disabilities Act.

CRC Health Group Inc., which waged a multiyear battle to open a methadone clinic in Warren, could seek damages for being blocked in its efforts. One of the potential expert witnesses called by the company estimated that the firm’s lost income could have been as great as $4.4 million.

In August 2011, residents adopted a new ordinance that restricted the location of methadone clinics and established 500-foot setbacks from homes, schools, churches, playgrounds, day care centers and libraries.

CRC had filed the federal lawsuit when the town imposed a moratorium on methadone clinics in order to develop that new ordinance.

The town has been deciding whether to oppose Magistrate John Rich III’s recommended ruling that the town violated the ADA by discriminating against people with opiate addiction.