BOSTON (AP) — A Massachusetts drug company has agreed to pay more than $35 million to resolve criminal and civil charges that it falsely marketed a cholesterol medication.

The U.S. attorney’s office in Boston said Friday that Aegerion Pharmaceuticals has agreed to plead guilty to two misdemeanor counts of violating federal law when it sold and promoted the drug Juxtapid as a general treatment for high cholesterol.

Federal regulators had approved the drug only for use in patients with a rare genetic disease that causes extremely high cholesterol. The drug may cause serious liver and stomach problems.

The civil settlement resolves a lawsuit filed by three former Aegerion employees, who are now entitled to a portion of the money.

An Aegerion spokeswoman hasn’t commented. The company is a subsidiary of Canada’s Novelion Therapeutics.