The U.S. government has refused for decades not only to do something about escalating gun violence but also to learn anything about it. This policy of willful ignorance is at long last expected to end under a federal budget that funds gun violence research for the first time in more than 20 years.

In a victory for House Speaker Nancy Pelosi’s Democrats as well as common sense, the $1.4 trillion spending legislation passed by Congress and signed by President Trump last week includes $25 million for the Centers for Disease Control and Prevention and the National Institutes of Health to study the toll of firearms.

Congress took its first step toward undoing the research moratorium last year with a budget provision clarifying that federal agencies are allowed to examine gun violence. But lawmakers did not provide funding for such studies until they approved the latest spending bills. While they provide a modest sum for research given the scope of the problem, the appropriation signals the demise of the see-no-evil stance Congress established in 1996.

That was the year that lawmakers carrying water for the gun lobby passed the so-called Dickey amendment, which revoked CDC funding for firearms research and prohibited federal agencies from conducting studies that “advocate or promote gun control.” That effectively eliminated crucial federal support for the understanding of a public health problem now responsible for the deaths of close to 40,000 Americans a year — nearly as many as are killed by automobile crashes or breast cancer, which the federal government spends hundreds of millions of dollars a year researching. This was such an absurd and counterproductive result that Jay Dickey, who authored the amendment while serving as a Republican congressman from Arkansas, called for a resumption of the research in 2015, writing, “Doing nothing is no longer an acceptable solution.”

Firearms killed 39,733 Americans in 2017, the most recent year for which the CDC has reported the data, the most in at least half a century and the highest rate per capita in 20 years. Though headline-grabbing mass shootings are also on the rise, they accounted for only about 1% of the killing that year.

It’s clear that much of this carnage could be prevented. Guns were involved in nearly two-thirds of U.S. homicides in 2016, about twice the share in Canada, five times that in Australia and 14 times the figure in England and Wales. Even within the context of this country’s permissive gun laws, state restrictions have made some places much safer from the violence than others. An Alabamian, for instance, is about three times more likely to die of a gunshot than a Californian.

“The key to solving any public health crisis is knowledge, and our efforts to prevent firearms-related injuries and deaths have been hampered by inadequate research,” Dr. Robert McLean, president of the American College of Physicians, said in a statement welcoming the new funding. The executive director of the American Public Health Association, Dr. Georges Benjamin, called the research “a top priority” for the organization and “a central piece in a much-needed public health approach to reduce gun violence in the United States.”

Congress and the president could, of course, do much more about gun violence, starting with universal background checks for firearms purchases and other measures to keep weapons out of the hands of dangerous people. The lifting of the research ban can only help make the case for more sensible policies.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.