A New York City pain management doctor was convicted on Friday of manslaughter and other charges for selling narcotics prescriptions to 20 patients, including two who fatally overdosed.

A jury in Manhattan Supreme Court found Stan Li, 60, guilty on nearly 200 criminal counts, including manslaughter, grand larceny and drug trafficking, the New York City Special Narcotics Prosecutor, Bridget Brennan, said in a statement.

Authorities in November 2011 arrested Li, who worked as a physician in New Jersey and ran a weekend pain clinic in Queens, following a three-and-a-half-year investigation sparked by complaints about his prescribing practices by his patients' families and the community.

The prosecutor's office said Li would see as many as 100 patients a day, many of whom would line up waiting for his clinic to open in hopes of buying prescriptions for drugs like oxycodone, Vicodin, Valium and Xanax.

One patient, Michael Cornetta, continued to get prescriptions from Li for more than a year, despite being treated in the emergency room twice for overdoses. In November 2010, 18 months after receiving his first prescription from Li, Cornetta overdosed and died, the prosecutor's office said.

Li was convicted of reckless endangerment in the second degree in connection with Cornetta's prescription, the statement said.

He was convicted of manslaughter for the deaths of 37-year-old Joseph Haeg and 21-year-old Nicholas Rappold, the prosecutor's office said.

"We believed that the public needed protection from criminally reckless conduct that purported to be medical treatment but resulted in loss of life, addiction, and harm to patients," Brennan said in the statement.

Li will be sentenced on Oct. 20, when he faces possible prison time, including up to 15 years behind bars for the top charge of manslaughter.

His attorney, Raymond Belair, said they were deeply disappointed and that the jury had mishandled the case.

"They clearly failed to follow the instructions given them. Our resolve to rectify this miscarriage of justice remains firm," he told Reuters.

(Editing by Barbara Goldberg and Eric Walsh)