BOSTON —  Massachusetts insurance companies will now be required to offer autistic people coverage for a range of treatments, under a bill Gov. Deval Patrick signed into law on Tuesday.

Parents of autistic children say the new measure closes a loophole in insurance plans that will help them pay for the cost of medicines and therapies. Advocates say it is one of the most comprehensive in the nation.

Yet business leaders oppose it, saying it will drive up the cost of health care benefits for workers as insurance premiums are already on the rise. They say that could make it especially tough for cash-strapped smaller businesses.

“This bill offers needed relief for individuals and families struggling to pay for the services they need,” Patrick said during a signing ceremony at Fenway Park.

The legislation, passed during the closing days of the Legislature’s formal session last week, mandates insurers cover the cost of diagnosis and treatment of autism spectrum disorder if it is deemed medically necessary by a doctor.

Those treatments include rehabilitative, psychiatric and therapeutic care, diagnostic tests, applied behavioral analysis as well as the cost of pharmaceuticals. Insurers would not be required to pay for in-school services.

The law also lets insurers opt out of providing coverage for three years if their costs rise by more than one percent a year.

Business groups say the costs of providing the extra coverage will fall largely on employers already struggling to cope with rising health premiums.

They said the law could increase the cost of health care coverage by as much as $340 million over the first five years, and that the average monthly increase in premiums could be as high as $2.45 per member.

Bill Vernon, state director for the National Federation of Independent Business, said the increase in health insurance premiums will cause small business owners to review benefit packages for their workers and could make it harder for them to hire new employees.

“Small businesses viscerally and universally oppose all health care mandates because they add to the already high cost of health insurance, restrict flexibility in designing health and other benefit packages for workers, and, perhaps most importantly, are unfair to small businesses,” Vernon wrote in a letter to Patrick.

Under the new law, insurers may not establish annual or lifetime service limitations on the coverage for the diagnosis and treatment of autism disorders that are less than that for physical conditions.

Insurers also may not limit the number of visits an individual may make to an autism services provider.

Bob Wright, co-founder of the advocacy group Autism Speaks, said the new law will end what he described as discrimination against families with autistic children.