George Floyd had fentanyl in his system when he was killed, and died from a heart attack ... according to the medical examiner.

The Hennepin County Medical Examiner released its toxicology findings and say George died from cardiopulmonary arrest ... which complicated law enforcement's subdual, restraint and neck compression of him. That is critical, but the report also says this under "how the injury occurred" -- they say George experienced "a cardiopulmonary arrest while being restrained by law enforcement."

In other words ... he suffered a heart attack while they were arresting him, and that complicated their efforts to subdue him.

The report also says George had fentanyl in his system, and they also found signs of recent methamphetamine use. It also says his manner of death is homicide.

The results were released just hours after the Floyd family's independent autopsy showed he died from "mechanical asphyxia" ... due to Derek Chauvin's knee on his neck, and another officer on his back.