WARREN, Maine — Residents voted overwhelmingly Thursday night to approve a settlement with a developer who had wanted to purchase the former Warren Primary School and lease it to a methadone clinic.

Residents voted 32-18 to approve the proposed agreement, said Town Clerk Melissa Sukeforth. The agreement calls for the former school to be auctioned with 60 percent of the proceeds going to Robert Emery Jr. and 40 percent to the town.

The deal would end a lawsuit brought by Emery and his company Vixen Land Holdings LLC against the town after Warren reneged on selling the property to him in 2010 when it became public that he planned to lease the site for a methadone clinic.

The lawsuit, filed earlier this year in Knox County Superior Court, is on hold pending the outcome of the proposed settlement.

The meeting lasted half an hour, Sukeforth said.

The building was constructed in 1963 and was originally Warren High School. The building became an elementary school after Medomak Valley High School opened in 1968. School Administrative District 40 turned the property over to the town in 2007 after it stopped using it.

At a special town meeting in September 2013, residents overwhelmingly approved spending $60,000 to demolish the former school building. That demolition, however, was put on hold at the advice of the town’s attorney in response to Emery’s lawsuit.

Another lawsuit by CRC Health Group, which originally planned to lease the property from Emery, remains active in U.S. District Court. No trial date has been scheduled for that case, in which CRC claims the town discriminated against it because it wanted to offer a clinic to treat opiate addicts.