MONTPELIER, Vt. — State lawmakers and political parties have received campaign money from prescription drug companies and allied groups even as Vermont continues to battle addiction to opioid painkillers.

A joint investigation by The Associated Press and the Center for Public Integrity found that drugmakers that produce opioid painkillers and allied advocacy groups spent more than $880 million on campaign contributions and lobbying over the past decade as they worked to influence state and federal policies in the United States.

The groups have an array of political interests that include opioid advocacy, and their spending was eight times that of the gun lobby during the same period. By comparison, groups advocating for limits on opioid prescribing spent about $4 million.

In Vermont, the drugmakers and allied groups contributed a total of $75,425 to candidates for state office and to state political parties from 2006 to 2015, though the total for 2015 has not been completed.

That ranked Vermont 20th among the states for the contributions from members of the Pain Care Forum, compared with overall contributions in the state.

Democratic Gov. Peter Shumlin made the fight against heroin and opioid abuse the centerpiece of his State of the State address in 2014. At the State of the State this year, he said the Food and Drug Administration’s approval of OxyContin in 1996 “lit the match that ignited America’s opiate and heroin addiction crisis.”

The investigation comes as the number of overdose deaths from prescription painkillers has soared, claiming the lives of 165,000 people in the U.S. since 2000.

In Vermont, there have been 661 drug-related deaths, mostly from prescription opioids and heroin, from 2006 to 2014.

Reporters analyzed campaign finance and lobbying data from 2006 through 2015, reviewed hundreds of documents and conducted more than 150 interviews. The AP and Center for Public Integrity found that drugmakers and allied groups employed an annual average of 1,350 lobbyists in state capitals around the country and contributed to a total of 7,100 candidates for state-level office.

In Vermont, the groups employed 16 to 29 registered lobbyists most years from 2007 to 2014. That put Vermont ninth in the country compared to the number of overall lobbyists in in the state.

Drug companies say they are committed to solving the problems linked to their painkillers. Purdue Pharma, one of the largest opioid producers by sales, said it does not oppose policies “that improve the way opioids are prescribed” even if they result in lower sales.

Like other states, the number of opioid prescriptions issued in Vermont has declined from 418,161 in 2013 to 388,108 in 2015.