NEW YORK — Suicides and drug overdoses pushed up US deaths last year, and drove a continuing decline in how long Americans are expected to live.
Overall, there were more than 2.8 million US deaths in 2017, or nearly 70,000 more than the previous year, the Centers for Disease Control and Prevention said Thursday. It was the most deaths in a single year since the government began counting more than a century ago.
The increase partly reflects the nation’s growing and aging population. But it’s deaths in younger age groups — particularly middle-aged people — that have had the largest impact on calculations of life expectancy, experts said.
‘‘These sobering statistics are a wake-up call that we are losing too many Americans, too early and too often, to conditions that are preventable,’’ Dr. Robert Redfield, the CDC’s director, said in a statement.
The suicide death rate last year was the highest it’s been in at least 50 years, according to US government records. There were more than 47,000 suicides, up from a little under 45,000 the year before.
The CDC did not provide state-by-state data, but the same factors driving the decline nationwide are also strong trends in Massachusetts.
Massachusetts has one of the highest rates of overdose deaths in the nation, with opioid-related mortality soaring from 2012 until 2016, followed by a slight decline in 2017.
The suicide rate in Massachusetts is among the lowest in the nation, but it’s been increasing faster than in most states. Massachusetts was one of 25 states that saw suicides increase by more than 30 percent from 1999 to 2016.
Dr. Monica Bharel, Massachusetts commissioner of public health, said she expected to see improvements in life expectancy in the near future.
“We expect that the work we’re doing in Massachusetts to decrease opioid-related overdose deaths may impact life expectancy over time,” Bharel said in a statement. “Because the opioid epidemic has primarily been an epidemic of young people, it has had an impact on statewide and national averages for life expectancy.”
For decades, US life expectancy was on the upswing, rising a few months nearly every year. Now it’s trending the other way: It fell in 2015, stayed level in 2016, and declined again last year, the CDC said.
(The most recent life expectancy statistics from the Massachusetts Department of Public Health date to 2015. That report shows an average life expectancy of 80.4 in 2015, higher than the national average. But after increasing steadily for decades, life expectancy in Massachusetts changed little from 2006 through 2015.)
The nation is in the longest period of a generally declining life expectancy since the late 1910s, when World War I and the worst flu pandemic in modern history combined to kill nearly 1 million Americans. Life expectancy in 1918 was 39.
Aside from that, ‘‘We’ve never really seen anything like this,’’ said Robert Anderson, who oversees CDC death statistics.
In the nation’s 10 leading causes of death, only the cancer death rate fell in 2017. Meanwhile, there were increases in seven others — suicide, stroke, diabetes, Alzheimer’s, flu/pneumonia, chronic lower respiratory diseases and unintentional injuries.
An underlying factor is that the death rate for heart disease — the nation’s No. 1 killer — has stopped falling. In years past, declines in heart disease deaths were enough to offset increases in some other kinds of death, but no longer, Anderson said.
(The CDC’s numbers do sometimes change. This week, CDC officials said they had revised their life expectancy estimate for 2016 after some additional data came in.)
CDC officials did not speculate about what’s behind declining life expectancy, but Dr. William Dietz, a disease prevention expert at George Washington University, sees a sense of hopelessness.
Financial struggles, a widening income gap and divisive politics are all casting a pall over many Americans, he suggested. ‘‘I really do believe that people are increasingly hopeless, and that that leads to drug use, it leads potentially to suicide,’’ he said.
Drug overdose deaths also continued to climb, surpassing 70,000 last year, in the midst of the deadliest drug overdose epidemic in US history. The death rate rose 10 percent from the previous year, smaller than the 21 percent jump seen between 2016 and 2017.
That’s not quite cause for celebration, said Dr. John Rowe, a professor of health policy and aging at Columbia University.
‘‘Maybe it’s starting to slow down, but it hasn’t turned around yet,’’ Rowe said. ‘‘I think it will take several years.’’
Accidental drug overdoses account for more than a third of the unintentional injury deaths, and intentional drug overdoses account for about a tenth of the suicides, said Dr. Holly Hedegaard, a CDC injury researcher.
The CDC figures are based mainly on a review of 2017 death certificates. The life expectancy figure is based on current death trends and other factors.
The agency also said:
—A baby born last year in the US is expected to live about 78 years and 7 months, on average. An American born in 2015 or 2016 was expected to live about a month longer, and one born in 2014 about two months longer than that.
—The suicide rate was 14 deaths per 100,000 people. That’s the highest since at least 1975.
—The percentage of suicides due to drug overdose has been inching downward.
—Deaths from flu and pneumonia rose by about 6 percent. The 2017-2018 flu season was one of the worst in more than a decade, and some of the deaths from early in that season appeared in the new death dates.
—West Virginia was once again the state with the highest rate of drug overdose deaths. The CDC did not release state rates for suicides.
—Death rates for heroin, methadone and prescription opioid painkillers were flat. But deaths from the powerful painkiller fentanyl and its close opioid cousins continued to soar in 2017.
The CDC did not discuss 2017 gun deaths in the reports released Thursday. But earlier CDC reports noted increase rates of suicide by gun and by suffocation or hanging.
Felice J. Freyer of the Globe staff contributed to this report.