With just three minutes left before the midnight end of the 2015-2016 legislative session, Massachusetts lawmakers voted to require insurers to cover long-term antibiotic treatment of Lyme disease.

The mandate became law with the stroke of Senate President Stan Rosenberg’s pen, over the objections of Gov. Charlie Baker, business groups and infectious disease specialists.

“Hundreds of people came to various members of the Legislature and told us about their battle with long-term Lyme disease and how they wanted to have long-term antibiotic treatment but their health insurance wouldn’t cover it,” said the bill’s sponsor, State Rep. David Linsky, D-Natick. “We feel that it is our duty to make sure that these people who want to have this treatment and have it prescribed by a licensed physician don’t have to go into financial ruin in order to get it.”

But Lora Pellegrini, president and CEO of the Massachusetts Association of Health Plans, said new mandates negatively impact small businesses and individuals who must pay more for insurance coverage. “Over time, those mandates add up,” Pellegrini said. She noted that while smaller businesses must abide by state mandates, the 60 percent of businesses — mostly large companies — that are self-insured do not.

Pellegrini said she worries about lawmakers passing the bill over the objections of doctors. “It does set a precedent that the Legislature’s just passed a mandate where there’s no scientific evidence that this will actually help patients, and the experts said it will hurt patients,” Pellegrini said.

Lyme disease is a tick-borne illness that can cause fever, headaches and fatigue. Massachusetts has one of the highest rates of Lyme disease in the country. While most people with Lyme disease are cured with short-term antibiotics, some people report longer-term symptoms.

The new law, which goes into effect immediately, requires insurers to cover long-term antibiotic treatment, when prescribed by a doctor. The mandate will cost the average person an additional 13 cents per month on their health insurance premiums, according to the independent Center for Health Information and Analysis.

Linsky stressed that the bill does not mandate any course of treatment, but simply requires insurance to cover treatment if it is recommended by a doctor. “It’s not the position of the Legislature or the governor or government at all to say what is the appropriate treatment for any particular illness,” Linsky said. “What this does is if a licensed physician in Massachusetts comes to the decision in his or her medical, clinical opinion that long-term antibiotic treatment is appropriate, in consultation with the patient, then that treatment should be covered.”

Insurers and business groups oppose the bill because it will raise the cost of insurance. More unique in this case was the effort by doctors to oppose the bill.

A group of doctors from Boston Children’s Hospital’s Division of Infectious Diseases wrote to legislative leaders, “Well-designed studies have shown that administration of additional or prolonged courses of antibiotics confers no benefit to patients who have had a standard course of accepted treatment for Lyme disease.”

The Massachusetts Infectious Diseases Society said the bill would require coverage for drugs when they are used “off-label,” in ways in which they are not generally prescribed for use. They said long-term antibiotic treatment can potentially lead to people becoming drug-resistant against other illnesses. “Far from improving the patient’s quality of life, prolonged antibiotic therapy may actually increase the patient’s suffering,” society president Daniel McQuillen wrote to legislators. McQuillen called the treatment “unproven and potentially unsafe.”

Christina Hermos, a pediatric infectious disease doctor at UMass Memorial Children’s Medical Center, wrote to lawmakers, “Not only is the use of long-term antibiotics contrary to the best evidence about Lyme, but it also puts our patients and community at risk for the very real risks of unnecessary antibiotic use.” Hermos said only a small number of doctors prescribe long-term antibiotics to treat Lyme disease, and it can cause harmful complications, such as infections, allergic reactions or drug-resistance to other diseases.

Baker vetoed the coverage mandate, which was included in the state budget. He sent a bill back to legislators that would have required MassHealth to hold a hearing on Lyme disease treatment, then publish a revised set of benefits available to Lyme disease patients. Private insurers would then have to provide the same level of coverage offered by MassHealth.

Baker wrote in his veto message that he opposes the legislation because it requires insurers to cover “unproven and potentially unsafe treatments for Lyme disease.”

“We should only be mandating coverage for evidence-based therapies that have proven to be clinically effective, whether we are considering the treatment of Lyme disease or any other medical disease or condition,” Baker wrote.

On Sunday, the Legislature overrode Baker’s veto by a vote of 153-3 in the House and 37-1 in the Senate. According to a State House News Service transcript, the votes were taken without discussion.