An Ohio hospital agreed to pay $6 million to Neil Armstrong’s surviving family members to settle allegations that medical malpractice after an emergency heart surgery caused the astronaut’s death, a report said.

The New York Times first reported Tuesday about the secret settlement after the paper received an anonymous 93-page document related to Armstrong’s treatment and the legal case.

The newspaper was able to confirm the documents were authentic using public records in Hamilton County Probate Court in Ohio.

Armstrong, the astronaut known for taking the first steps on the moon in 1969, died at the age of 82 on Aug. 25, 2012 — two weeks after undergoing cardiac bypass surgery at Cincinnati’s Mercy Health-Fairfield Hospital.

APOLLO 11’S MICHAEL COLLINS RECOUNTS THE CREW’S THREE-WEEK QUARANTINE ON THEIR RETURN FROM THE MOON

At the time of his death, the family announced publicly that Armstrong had died from “complications resulting from cardiovascular procedures.”

Privately, Armstrong’s two sons, Mark and Rick Armstrong, accused the hospital of flawed postsurgical treatment that ultimately killed their father, launching a two-year legal battle between the family and the medical institution.

Armstrong underwent cardiac bypass surgery on Aug. 7, 2012. As a standard part of the procedure, doctors implanted temporary wires to help pace his heartbeat as he recovered, the Times reported. “But when a nurse removed those wires, Mr. Armstrong began to bleed internally and his blood pressure dropped.”

Doctors took Armstrong to a catheterization lab to drain blood from around his heart instead of immediately bringing him into the operating room, a decision that medical professionals hired by both the Armstrong family and the hospital to investigate the death concluded to be the cause that ultimately killed him

Wendy Armstrong, a lawyer and the wife of Mark Armstrong, suggested in a July 2014 email that the astronaut’s two sons would speak publicly about the medical malpractice claims at an event at Kennedy Space Center commemorating the 45th anniversary of the first moon landing if the hospital did not pay up.

“No institution wants to be remotely associated with the death of one of America’s greatest heroes,” lawyer Bertha G. Helmich, who represented Armstrong’s grandchildren in the suit, wrote the hospital, according to documents obtained by the Times.

CLICK HERE TO GET THE FOX NEWS APP

Mercy Health denied the malpractice claim but agreed to pay the Armstrong estate $6 million “to avoid the publicity of litigation,” according to a motion filed by Wendy Armstrong.

Mark and Eric Armstrong were granted $5.2 million from the settlement, the Times reported. Armstrong’s brother and sister, Dean A. Armstrong and June L. Hoffman, each received $250,000. Six grandchildren received $24,000 each. Armstrong’s widow and second wife, Carol, was not involved in the settlement.

News of the settlement broke this Tuesday, just days after the 50th anniversary of Armstrong's moon landing was celebrated on Saturday.