The American way of dying seems to have become less frantic, desperate and expensive.

That’s the upshot of a study that finds that seniors insured by Medicare who died in 2015 were less likely to do so in a hospital and more likely to die in a home or other community setting than those who died in 2000.

The research showed that the proportion of seniors who were admitted to the intensive care unit in their final month of life has stabilized after rising between 2000 and 2009. By 2015, 29 percent of dying patients insured by Medicare spent part of their final month of life in the ICU.

The study also chronicled a slight decline in the proportion of Medicare patients who spent time on a ventilator during their final days and whose last three days of life were affected by a transfer from one institution to another, such as from a nursing home to the hospital.

The findings in the Journal of the American Medical Association were based on an analysis of records from 1,361,870 Medicare fee-for-service enrollees and 871,845 Medicare Advantage enrollees who died between 2000 and 2015. Their average age at their death was 82.

In all, just less than 20 percent of patients who died in 2015 did so in an acute-care hospital, down from 32.6 percent in 2000. Some 40 percent of these patients died in a home, hospice, assisted living facility or other community setting in 2015 — up from about 31 percent in 2000.

Those shifts took place during a period of sweeping changes in U.S. medical care. As the 21st century got underway, palliative care gained a foothold in U.S. hospitals. This new medical specialty focused on improving the quality of life for very ill patients.

Then, with the adoption of the Affordable Care Act in 2010, hospitals adjusted to new rules aimed at improving the quality of care and reducing expensive patient readmissions. Meanwhile, doctors and hospitals began reassessing end-of-life care. Studies chronicled many terminal patients’ final days of treatments that were invasive, painful and futile. Other research toted up the stress experienced by surviving family members.

Physicians began to ask whether such “heroic measures” was saving lives or poisoning deaths. In 2014, that debate culminated in a report by the National Institute of Medicine that defined a “good death” as one that is “free from avoidable distress and suffering for patients, families and caregivers” and “in general accordance with patients’ and families’ wishes.” A patient’s death in the ICU “is seldom viewed as a good death,” it said.

“There was a greater collective awareness that not all medical interventions are equally beneficial, and that the potential harms of some needed to be weighed,” said Dr. Diane E. Meier, a geriatrician.

The analysis also yielded a wealth of small details about changing practices in end-of-life care. It found that the use of hospice services increased from 21.6 percent in 2000 to more than 50 percent in 2015. The the share of patients who had three or more hospitalizations in their last 90 days of life declined from 11.4 percent in 2009 to 7.1 percent in 2015. And the share of patients who spent part of their final four days on a ventilator fell from 3.1 percent in 2000 to between 2.5 percent and 2.7 percent by 2015.