BOSTON — A controversial four-month ban on the sale of vaping products in Massachusetts survived an initial test in federal court Friday, preserving for now the strongest measure taken by any state to combat vaping-related lung injuries that are on the rise.

U.S. District Judge Indira Talwani denied a temporary restraining order sought by vaping shops and companies to halt the ban. In two written orders after a morning hearing, she wrote the plaintiffs did not demonstrate hardships are in their favor or the threat of irreparable harm. She said granting the temporary restraining order would conflict with the public interest.

But a broader legal challenge to the ban won't be decided until later this month. The judge set a hearing for Oct. 15 to take up the plaintiffs' request for a preliminary injunction to stop the ban, which Republican Gov. Charlie Baker announced Sept. 24.

The judge's decision followed a morning hearing on the lawsuit brought by vape shops and vaping companies against Baker and the commonwealth of Massachusetts.

The ban applies to online and retail sale of all kinds of nicotine and marijuana vaping products and devices, and extends through Jan. 25, 2020. Retail shops were forced to clear shelves of products after a state health board approved Baker's plan.

More:Vaping-related lung injury cases surge to 1,080; deaths rise to 18

In deciding against a temporary restraining order, Talwani ruled the companies have not suffered "irreparable harm" to warrant immediate relief.

Separate complaints in Boston federal court came from a coalition of five Massachusetts vape shops and the Vapor Technology Association, the lobbying arm of e-cigarette companies and vaping products.

The Centers for Disease Control and Prevention announced Thursday vaping-related lung injury cases have jumped to 1,080 and at least 18 have died. The specific causes of the illnesses are still not clear. Ten cases of vaping-related lung injuries have been reported in Massachusetts.

Nearly four in five cases associated with the outbreak involved people vaping products with THC, alone or with nicotine, the CDC said this week. The agency has recommended that people refrain from using vaping products, particular those using THC, the principal psychoactive compound in marijuana.

Joseph Terry an attorney representing vaping companies, said the ban "presents an existential threat to their businesses and their industry." He said retail shops have had to let go employees and have struggled to pay rent, which he argued means they've been "irreparably harmed."

"My clients told me we are going to go out of business in the next couple of weeks if there's not a resolution to this," he said.

But the judge argued the companies can still sell outside of Massachusetts.

More:Massachusetts bans all vaping products for 4 months in the toughest state action taken yet

Terry also pointed out that most of the lung injuries appear to involve marijuana vaping products, not nicotine vaping devices like his clients sell.

Julia Kobick, the state's attorney, however noted both nictorine and THC are a factor and it's not clear exactly what is making people sick.

'We know that something in the vaping products is causing hundreds of Americans to experience respiratory problems. We don't know what's causing these Americans to have to be hospitalized," Kobick said.

She said the government recognizes economic hardships will result, but said it's "not enough to warrant the extraordinary relief that these plaintiffs seek here."

Talwani said the case has "the ring of past history" when representatives of the nicotine industry would tell the public there was no medical issues with their products.

"They're safer than cigarettes for people who are using cigarettes. But they aren't safer for people who weren't smoking cigarettes," she said. "They (The CDC) haven't said, tell your children it's OK to vape."

The CDC's latest count of vaping-related illnesses marked a significant increase from last week's total of 805 vaping-related lung cases and 12 deaths.

Craig Rourke, the attorney for the vape shops, said Baker's ban was "done in an overly broad way and done in a way that was hast." He said vaping stores have lost an average of $5,000 a week.

"This has very real consequences because most people live week to week and these employees have been laid off," he said.

Nonetheless, he said he doesn't consider the judge's decision a setback, and pointed to the temporary injunction hearing in less than two weeks.

Linda Vick, owner of Vick's Vape Shop in Medford, Massachusetts, said the ban has forced the closure of her store, hurting her ability to care for her autistic child. "The fact that I might not be able to take care of him is not OK.

She blamed the illnesses on black market products involving THC. Marijuana was legalized for recreational use in Massachusetts last year.

"This vaping has been out for almost 12 years, and it's around the whole world not just the United States," she said. "How come all of a sudden in just the past eight months everyone is getting sick and not in the past 12 years?"

Reach Joey Garrison on Twitter @joeygarrison.