Facing an explosion of vaping-related illnesses, Governor Charlie Baker took aggressive action Tuesday, ordering a four-month ban on the sale of all vaping products in Massachusetts in what is the most sweeping prohibition targeting electronic cigarettes in the United States.

Baker’s decision to declare a public health emergency — and apply the ban to both tobacco and marijuana vaping products — quickly reverberated through the country, drawing praise from concerned medical professionals and consternation from the fledgling legal cannabis industry.

The ban, which the state’s Public Health Council quickly approved Tuesday, took effect immediately and will last through Jan. 25, though Baker and the council could choose to extend it. It includes both flavored and unflavored vaping products, and applies to both online and retail sales.

The Baker administration stressed that the decision is intended to allow the medical community and federal officials time to investigate what’s driving the spike in illnesses, which have been tied to nine deaths and 530 cases nationwide. Massachusetts officials have reported 61 possible cases in the state as of Monday — a jump from 38 just last week.

Baker pointed to a Friday meeting with doctors and medical professionals as a motivation to take action, saying he found their experiences treating patients “deeply troubling.” He described a complicated, multifaceted problem that raises many questions, from what types of additives are to blame for the current outbreak to even what parts of electronic cigarette devices — which typically heat liquid with battery-activated coils — may be helping drive it.

“One of the experts said that, ‘We don’t have time to wait. People are getting sick and the time to act is now.’ I couldn’t agree more,” the Republican said at a State House news conference with state health officials and doctors.

Dr. Alicia Casey, a pediatric pulmonologist at Boston Children’s Hospital who appeared alongside Baker, described treating teens who required ventilators to breathe and could suffer permanent lung damage after vaping.

“I can assure you that these products are not safe,” she said. “This ban is a critical and necessary step to combating this epidemic of youth vaping.”

Massachusetts’ decision to temporarily ban all vaping products statewide goes much further than other states. Both New York and Michigan earlier this month outlawed the sale of flavored e-cigarettes, but did not ban all products. San Francisco in June became the first major city in the country to ban the distribution or sale of e-cigarettes.

Meanwhile, in Rhode Island, Governor Gina Raimondo indicated she, too, will take action Wednesday, and California officials are advising people to stop vaping immediately.

Baker said his administration is also weighing whether to file further regulations or legislation, a decision he said will be shaped by the ongoing investigation into the root cause of the illnesses.

State law gives the governor wide authority to declare a public health emergency, as well as health officials to take action to “insure the continuation of essential public health services.” Baker’s declaration specifically cited both national and state data on vaping cases, arguing it’s necessary for health officials to take immediate action.

Massachusetts retailers indicated they intend to comply with the order. Jonathan Shaer, executive director of the New England Convenience Store & Energy Marketers Association, said the group “understands” why Baker called for the prohibition on the products, and will tell its members, which include gas stations, so they can “remove them from their shelves right away.”

The Baker administration said it intends to release guidance for retailers, but stressed that while they’re currently “not being asked to destroy products,” those products need to be removed from the shelves “immediately.”

The move nonetheless caught many by surprise.

“My chin hit the floor,” said Geoffrey Yalenezian, chief operating officer of Brennan’s Smoke Shop, a chain of eight stores in Southeastern Massachusetts. He added that Baker is “not changing or stopping anything. He’s taking a stance. His stance is I don’t really care about small businesses in Massachusetts.”

Public health advocates said the ban helped fill a void left by a lack of adequate regulation by the US Food and Drug Administration, which gained the authority in 2016 — but has yet to take comprehensive action — to regulate vaping products.

An FDA spokeswoman said Tuesday that the agency was “working tirelessly” to investigate the vaping-related lung illnesses, and was “committed to taking appropriate actions as a clearer picture of the facts emerges.”

The Massachusetts ban will be enforced by the state Department of Public Health and local boards of health, with help from local law enforcement, Baker said. His administration has also had “conversations” with the state’s Cannabis Control Commission, which said in a statement it would be “communicating with its licensees to ensure awareness of and compliance” with the order.

The announcement, however, quickly sent shockwaves through the marijuana industry. Shaleen Title , a member of the five-person Cannabis Control Commission, said the order will only encourage consumers to use riskier, unregulated products sold in spite of the ban.

“This is a terrible decision,” Title wrote on Twitter. “Purposely pushing people into the illicit market — precisely where the dangerous products are — goes against every principle of public health and harm reduction. It is dangerous, short-sighted, and undermines the benefits of legal regulation.”

David O’Brien, the president of the Massachusetts Cannabis Business Association, urged the Baker administration to quickly investigate and clear vaping products at regulated marijuana shops, insisting they have not been linked to the acute lung illnesses affecting dozens of patients in the state.

“There seems to be a conflation of all things vaping,” O’Brien said. “Stores will do what they’re told, but let’s not have an elongated time-out — let’s figure out what’s at issue, and if legal cannabis is not the issue, then let it be sold. I strongly suspect it isn’t.”

For licensed marijuana companies in Massachusetts, the temporary ban on vaping products could be detrimental. Last week, marijuana concentrates such as vaping cartridges made up about 19 percent of total marijuana product sales across the state, according to Cannabis Control Commission data. And that’s after vaping sales dropped about 25 percent over the last six weeks.

Chris Harkins, founder of cannabis company Northeast Alternatives, which operates an adult-use marijuana store in Fall River, said vaping products make up about 25 percent of their overall sales.

“From our perspective, it’s just a major overreaction,” Harkins said.

State lawmakers are already pushing separate bills that would permanently ban all flavored tobacco products, including the liquid used in e-cigarettes and other vaping devices.

That ban, which supporters have said would be the furthest-reaching in the country, would apply to all flavors, including menthol, mint, and wintergreen, which to date have often been exempted from flavor-related regulations on the grounds they are “adult” flavors.

Senate President Karen E. Spilka has backed permanently banning flavored vaping products. House Speaker Robert A. DeLeo has not said publicly where he stands on a flavored vaping ban, but indicated that a legislative committee could move on the bill after polling its members on Tuesday.