Operations to replace a knee or a hip appear to increase heart attack risk in the short term and the risk of blood clots in the long term, according to a new study.

The heart attack risk falls again over time, but blood clot risk is still elevated years later, the researchers found.

The reason for the elevated risks is unclear at this point, said senior author Yuqing Zhang of Boston University School of Medicine in email to Reuters Health.

Regardless, he said, the findings suggest that the risk of a heart attack in the weeks after total joint replacement surgery "may have been previously underappreciated," and ways to prevent this serious complication may need to be considered.

Zhang and colleagues studied roughly 40,000 patients age 50 or older, all with osteoarthritis. They compared 13,849 patients who underwent total knee replacement to 13,849 closely matched people who did not have surgery. They also compared about 6,000 patients who had hip replacement surgery to 6,000 who did not.

Within a month after the operations, there were 35 heart attacks among knee replacement patients, compared to four in the control group. In that same period, there were 13 heart attacks in the hip replacement group vs three in the control group.

Heart attack risk was highest in that first month following surgery and declined again over time, the authors reported in Arthritis & Rheumatology. By three years after the operations, heart attack rates had evened out for the surgery groups and the control groups.

As for a type of blood clot known as a venous thromboembolism, the knee replacement patients had 190 in the first month, compared to three in the control group. The hip surgery patients had 78; the control group had just one.

Five years later, the odds of having a venous thromboembolism were still significantly higher in the surgery groups.

Dr. Frank de Vries of Maastricht University Medical Center in The Netherlands told Reuters Health by email that the excess risk may have appeared to stay high because some of the patients in this study would likely have required further surgeries on the affected joint or elsewhere, though that was not accounted for in the analysis.

A previous study had suggested that joint replacement may actually decrease heart risk in the long run and help protect the cardiovascular system.

In that earlier study, the researchers analyzed not just heart attacks but also strokes and coronary revascularization, and they took arthritis severity into account, Dr. Bheeshma Ravi of the University of Toronto told Reuters Health by email.

The new study does not negate the previous findings, said Ravi, who worked on the earlier study.

de Vries, who wasn't involved in the new study, said orthopedic surgeons need to discuss the risk of heart attack with their patients well before the surgery.

Indeed, Zhang said, the health risks and benefits of joint replacement surgery remain complicated and this study's findings cannot quantify them for an individual patient.