The last two decades have brought both a sharp decline in automaking jobs in the United States and the rise of a deadly epidemic of opioid abuse. According to a new study, the two trends may well be related.

The study, published Monday in JAMA Internal Medicine, found that opioid deaths were about 85 percent higher among people of prime working age in counties where automotive assembly plants had closed five years earlier, compared with counties where such factories remained open.

That finding underscores the role that economic despair may play in eroding public health.

“For a long time, we’ve been interested in the link between the American dream and America’s health, namely that the fading American dream actually has population health consequences,” said Dr. Atheendar Venkataramani, the lead author of the paper and a professor of medicine at the University of Pennsylvania. “It’s an unfortunate natural experiment when you have a disintegration of an industry like this through plant closures in that it allows us to understand what the consequences of those negative events are.”

While the findings are in line with previous research that has linked job displacement to higher death rates, attempts to tie economic conditions specifically to opioid overdoses and deaths have yielded mixed results.