Pennsylvania's medical marijuana program took an ugly turn Friday as a Scranton-based company sought an injunction demanding that the state rescind a permit to grow and process cannabis awarded to a rival, Pennsylvania Medical Solutions.

Pennsylvania Medical Solutions is a subsidiary of Vireo Health, a Minnesota-based concern whose employees allegedly smuggled $500,000 in hash oil across state lines.

BrightStar Biomedics contends that the state should have barred Pennsylvania Medical Solutions from participating in the Pennsylvania program because of the illegal diversion. In its Commonwealth Court filing, BrightStar also accused the state's Office of Medical Marijuana of violating the law when it awarded Pennsylvania Medical Solutions the permit because the parent company was the subject of "ongoing criminal investigations, license revocations, and administrative penalties."

Prosecutors in Minnesota have accused two former Vireo employees, a chief medical officer and a security officer, of smuggling three kilograms of THC oils in an armored vehicle to an affiliated dispensary in New York. According to a judge's order, the employees allegedly justified the December 2015 incident as a way to "rescue New York" from missing a key state-mandated deadline. The employees allegedly staged a cover-up. The plot was revealed by a Vireo whistle-blower.

Nothing about Minnesota's criminal investigation appears to have been included on the Pennsylvania Medical Solutions application to grow marijuana in Pennsylvania, though it's difficult to tell: That section on the publicly available version of the application, submitted in March, has been redacted and completely blacked out.

"It is unfortunate, but not entirely unexpected, when a company turns to the courts after failing to win a medical cannabis license in a merit-based process," Vireo spokesman Andrew Mangini said in a statement. "We will not let matters like these distract us from our mission of providing medical cannabis products to patients suffering from life-threatening and debilitating conditions."

BrightStar's complaint makes it clear that it would be ready to grow marijuana in Scranton if Pennsylvania Medical Solutions is disqualified.

In June, an anonymous panel convened by the Pennsylvania Department of Health awarded Pennsylvania Medical Solutions one of 12 coveted permits to grow and process marijuana. Also that month, the State of Maryland revoked the license of Pennsylvania Medical Solutions affiliate MaryMed LLC, citing "a reasonable likelihood of diversion of medical cannabis by the applicant" and "evidence of a lack of good moral character."

Pennsylvania Medical Solutions' application outscored BrightStar's by a mere 3.42 points out of 1,000. Pennsylvania Medical Solutions received higher scores on meeting an operational timetable, security and surveillance, inventory management, and employee qualifications. The companies' scores on diversion prevention were roughly equivalent: Pennsylvania Medical Solutions was awarded 36.40 points to BrightStar's 36.50.

"It is unlikely PMS would have narrowly edged out BrightStar had the breadth of its legal problems been known," said attorney Mark Sheppard of Montgomery, McCracken, Walker & Rhoads.

If allowed to proceed, Pennsylvania Medical Solutions will start growing cannabis in December in a Scranton industrial park.

A spokeswoman for the state Health Department declined to discuss questions about Vireo.

"We are moving forward with a patient-focused medical marijuana program to get Pennsylvanians with serious medical conditions the help they desperately need," spokeswoman April Hutcheson said in a statement.

According to state law, the department has the power to suspend or revoke a permit if it finds "evidence that the medical marijuana organization has failed to maintain effective control against diversion of medical marijuana."