Hundreds of hospice care facilities across the country were found to have serious, life-threatening deficiencies, according to an investigation by the Department of Health and Human Services Office of Inspector General that was obtained by NBC News.

Severe complaints were lodged over unsanitary conditions at some facilities and over patient wounds that were badly treated or not treated at all at others.

More than 300 hospice facilities out of the 4,563 surveyed nationwide between 2012 and 2016 were considered poor performers, according to the IG’s report.

“Those numbers are surprising and, frankly, they’re unacceptable,” Erin Bliss, assistant inspector general at HHS, said.

Almost every hospice center in the country that provided care to patients receiving Medicare benefits was part of the study, the most in-depth of its kind ever undertaken relating to hospice care.

According to HHS statistics, Medicare spent $17.8 billion for hospice care for almost 1.5 million beneficiaries in 2017. Hospice care is generally considered appropriate for terminally ill patients with a life expectancy of six months or less.

More than 80 percent of hospice facilities had at least one deficiency, most of those had multiple deficiencies, 1 in 5 had a serious deficiency.

“When we looked into some of the more extreme examples of how those deficiencies can impact patients, we found cases where patients were actually harmed by their hospice care,” Bliss said.

Investigators uncovered shocking examples of poor care or abuse that included the following:

A patient’s wounds were not treated properly resulting in gangrene and the patient’s leg having to be amputated.

Maggots were allowed to develop around a patient’s feeding tube.

Hospice workers failed to recognize signs of a possible sexual assault of a patient.

A patient went two years before anyone treated her for a wound.

Poorly trained staff attempting to move a patient dropped her on the floor resulting in a broken leg.

In some cases, criminal charges have been filed against hospice facilities, owners and employees.

In one sweeping federal investigation in North Texas, 16 people were indicted in what was described by prosecutors as an elaborate $60 million Medicare fraud scheme. Nurses admitted to overmedicating patients to quicken their deaths and secure higher payments from Medicare, resulting in several overdose deaths. Seven defendants have already pleaded guilty in that case and nine others are slated for trial later this year.

In its report, the IG found numerous cases of fraud, including hospice centers that enrolled patients who were not terminally ill, altering patient records and billing for services that were never provided.

Some hospice facilities were also cited for inadequate training, failing to monitor medications, providing fewer services than were called for in a patient’s plan, and not conducting proper criminal background checks on employees.

According to the study, California, South Carolina and Texas had the worst performers.

The Centers for Medicare and Medicaid, known as CMS, is the HHS agency responsible for administering the Medicare program for the federal government. Bliss said the investigation found that CMS needs to improve its oversight of hospices through additional enforcement tools, better collection and analysis of deficiency data, and ensuring that data be made more available to the public.

“Hospice patients and their families are some of the most vulnerable,” Bliss said. “We’re talking about people that are dealing with a terminal illness for themselves or their loved ones. And so we think that Medicare should make it as easy as possible for them to get good information about their hospice options and the track records of those providers and how to make complaints in the event that they do run into a problem or are concerned about their hospice provider.”

In a statement provided to NBC News, a CMS spokesperson said, “CMS has zero tolerance for abuse and mistreatment of any patient, and CMS requires that every Medicare-certified hospice meet basic federal health and safety standards to keep patients safe."

“The OIG’s findings are based on cases that occurred between 2012 and 2016, a selective sample of the most serious cases of harm found during hospice surveys. In these cases, CMS cited the hospices for failing to meet certain requirements in the Medicare and/or Medicaid programs," the statement said.

CMS added that this year the agency issued new guidance to surveyors who inspect hospice facilities to help them more quickly identify and address the most grave patient safety situations. The agency said it is making hospice quality information easier for consumers to find and understand on its Hospice Compare website.

Mollie Gurian, the chief strategy Officer for The National Partnership for Hospice Innovation, an organization representing not-for-profit hospice providers across the country, told NBC News she agrees with the HHS OIG findings and recommendations.

"We are strongly in favor of increasing oversight on hospice programs that deliver poor-quality care," said Gurian. "Throughout our organization’s history, we have encouraged the Centers for Medicare and Medicaid Services to shift their focus from penalizing deficiency-free programs to the exact kinds of programs these reports address — those that cause serious harm to patients and their families."

The Office of Inspector General encourages anyone who has experienced or witnessed abuse, neglect, poor care or financial irregularities in a hospice to contact the hospice administrator, the state department of health, the Medicare hotline at 1-800-Medicare or the police if someone feels a potential crime has been committed.