WASHINGTON — Red-light cameras are widely hated, but a new study says getting rid of them can have fatal consequences.

Traffic deaths from red-light-running crashes go up by nearly a third after cities turn off cameras designed to catch motorists in the act, according to a study by the Insurance Institute for Highway Safety. The institute is funded by auto insurers.

While cities continue to add cameras at intersections with traffic signals, at least 158 communities have ended their red-light camera programs in the past five years, the study said.

Researchers compared trends in annual crash rates in 14 cities that had ended their camera programs with those in 29 cities in the same regions that continued their camera programs.

They found that, after adjusting for other factors, red-light- running crashes went up 30 percent.

Further, all types of crashes at intersections with traffic signals went up 16 percent. That finding suggests that red-light cameras deter other behavior by motorists, not just red-light running, said Wen Hu, co-author of the study.

A second part of the study compared fatal red-light-running crashes in 57 cities with camera programs to 33 cities that haven’t introduced cameras, finding that the rate of such crashes was 21 percent lower in cities with cameras. The rate of all types of crashes at intersections with traffic signals was 14 percent lower when cameras were present.

“Debates over automated enforcement often center on the hassle of getting a ticket and paying a fine,” said the institute’s president, Adrian Lund. “It’s important to remember that there are hundreds of people walking around who wouldn’t be here if not for red-light cameras.”

Dozens of communities have ended their red-light camera programs in recent years amid complaints that they are designed primarily to raise money through tickets rather than to enhance safety. Courts in some states have sided with motorists against camera programs.