The embattled nonprofit will hand over operation of its clinics and shelters to two other healthcare providers.

Narco Freedom founder Alan Brand and his son used the cash from their alleged scheme to buy big houses and condos on Long Island and in Florida, along with a fleet of luxury cars, authorities said when the pair was busted in October 2014.

“Narco Freedom defrauded the government and profited from the exploitation of people most in need of their help,” Manhattan US Attorney Preet Bharara said in a statement Monday.

“Enjoining Narco Freedom from continuing to engage in the kickback scheme and transitioning its clinics and houses to other providers will provide this vulnerable population with the continuity of care and housing they sorely need.”

Manhattan federal Judge John Koeltl said Narco Freedom’s operations should be concluded by Sept. 22 and ordered handover notices posted in all Narco Freedom buildings.