Hospitalized Covid-19 patients treated with hydroxychloroquine had a higher risk of death compared with those who didn't take the anti-malaria drug, according to a study in The Lancet.

The study looked at more than 96,000 patients across six continents.

Patients who took the drug or chloroquine, which hydroxychloroquine is derived from, were also more likely to develop irregular heart rhythms.

A pack of Hydroxychloroquine Sulfate medication is held up on March 26.

John Phillips | Getty Images

Hospitalized Covid-19 patients treated with hydroxychloroquine, the malaria drug President Donald Trump says he's taking to prevent the coronavirus, had a higher risk of death than those who didn't take it, according to a study published Friday in The Lancet.

Patients who took the drug or chloroquine, which hydroxychloroquine is derived from, were also more likely to develop irregular heart rhythms, according to the study. The study looked at more than 96,000 patients from 671 hospitals across six continents.

Researchers at Harvard Medical School, Brigham and Women's Hospital and other institutions looked at patients who were hospitalized with Covid-19 between Dec. 20 and April 14. They said 14,888 patients were treated with hydroxychloroquine or chloroquine, either alone or in combination with a macrolide. The remaining 81,144 patients were in the control group.

Nearly 10,700 patients died in the hospital. The study found that after controlling for multiple factors, including age, race, sex and underlying health conditions, there was a 34% increase in risk of mortality for patients who took hydroxychloroquine and a 137% increased risk of serious heart arrhythmia.

White House physician Dr. Sean Conley released a memo Monday evening, saying that after discussing evidence for and against hydroxychloroquine with Trump, the two concluded "the potential benefit from treatment outweighed the relative risks."

The White House did not immediately respond to CNBC's request for comment on the study.

Hydroxychloroquine, which has been repeatedly touted by Trump as a potential game changer in fighting the coronavirus, is also often used by doctors to treat rheumatoid arthritis and lupus. Numerous clinical trials are looking to see if it's effective in fighting the coronavirus, but it is not a proven treatment.

Hydroxychloroquine is known to have serious side effects, including muscle weakness and heart arrhythmia. A small study in Brazil was halted for safety reasons after coronavirus patients taking chloroquine developed arrhythmia, including some who died.

Last week, a study published in the JAMA Network found the drug appeared to not help Covid-19 patients and, instead, placed them at increased risk of cardiac arrest.

The study published Friday analyzed medical records of Covid-19 patients. It was not a randomized controlled trial, which is considered the gold standard in science. It was funded by the William Harvey Distinguished Chair in Advanced Cardiovascular Medicine at Brigham and Women's Hospital.