HELENA, Mont. — Pharmaceutical companies and associated organizations have spent relatively little in Montana over the past decade to advocate for policies friendly to their cause, though a patients group is pushing for new laws after two state doctors were accused of overprescribing pain medication.

A group calling itself Pain Patients of Montana made its case in March to an interim legislative committee to introduce a Pain Patients’ Bill of Rights in the next legislative session, which begins in January. The proposal would, among other things, codify in state law that patients with chronic intractable pain have the right to choose or refuse opioids and add protections for doctors who prescribe them.

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. 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.

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. 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.

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.

The push for the legislation in Montana comes as Dr. Chris Christensen of Florence is preparing to stand trial next year for overprescribing pain medication to patients. He faces 400 felony charges, including negligent homicide for the overdose deaths of two patients.

Earlier this year, the state Board of Medical Examiners suspended the medical license of Dr. Mark Ibsen after finding he prescribed excessive quantities of narcotics to five patients. A Helena judge temporarily blocked the suspension while Ibsen challenges the board’s action.

It is not clear what relationship, if any, the Pain Patients of Montana group has to the Pain Care Forum, a loose coalition of drugmakers, trade groups and dozens of nonprofits supported by industry funding that has flown under the radar until now. It also is not clear whether the Pain Patients of Montana’ bill of rights will be heard during the legislative session, as the interim committee that heard its March presentation decided not to forward a bill for introduction.

Individual members of the Pain Care Forum made 244 donations amounting to more than $413,000 to Montana candidates between 2006 and 2015, though only $22,000 of that went to state candidates and parties. The rest went to federal candidates, including all three members of the state’s current congressional delegation.

Forum members employed 10 lobbyists in Montana in 2015, which is down from a high of 18 in 2010.