(CNN) — People who have had heart attacks can boost their chances of long-term survival by returning to normal levels of sexual activity, a new study shows.

Many people stop having sex after a heart attack in the belief that it could trigger another episode, but research published Wednesday in the European Journal of Preventive Cardiology says sex is good for survival rates.

Researchers followed 495 couples for around 20 years and found that those who maintained or increased their frequency of sexual activity in the first six months after a heart attack had a 35% lower risk of death than those who stopped having sex or reduced their frequency.

“Sexuality and sexual activity are markers of wellbeing,” study author Professor Yariv Gerber of Tel Aviv University in Israel said in a press release.

“Resumption of sexual activity soon after a heart attack may be a part of one’s self-perception as a healthy, functioning, young and energetic person. This may lead to a healthier lifestyle generally.”

While sudden physical exertion, such as having sex, can trigger a heart attack, the long-term risk of heart problems is reduced by regular physical activity, the researchers said.

While isolated episodes of sexual activity have been shown to trigger heart problems in some cases, people who exercise regularly are at lower risk.

The 495 patients were aged 65 years or under and hospitalized for their first heart attack in 1993. Their average age was 53 and 90% of them were men.

Researchers found that after 22 years, 211 patients, or 43% of the total participants, had died.

They then adjusted for factors such as obesity, physical activity and socioeconomic status to determine the difference in risk of death between the two groups, and found that the survival benefit “was mostly attributable to a reduction in non-cardiovascular mortality such as cancer” — ie, the people in the group who died had mainly fallen victim to conditions other than heart disease.

Gerber told CNN that people who can climb stairs or jog or walk a mile without difficulty are safe to have sex again — a caveat that brings to mind the famous scene in the movie “Something’s Gotta Give,” in which heart attack patient Jack Nicholson has to prove he can climb a flight of stairs before he can have sex with Diane Keaton.

Patients should also resume sexual activity “as soon as possible,” Gerber told CNN, “preferably within a few days after hospital discharge.”

However, the severity of the heart attack, as well as complications such as heart failure or atrial fibrillation, can affect the ideal time frame, and individual patients should consult their doctors, Gerber added.

While this study did not examine the ideal frequency of sexual activity, Gerber told CNN that his research group has previously shown that “even a low frequency of less than once a week was associated with better long-term survival compared with no sex at all.”

Gerber said sexual activity is a marker for a better recovery because of “improved physical fitness, stronger spouse relations, and a mental ability to ‘bounce back’ from the initial shock of the event within a few months.

Those who believe they are in poor health may be less likely to resume sexual activity, Gerber added, and they may also be less likely to attend cancer screenings or other health checkups.

“This may explain the strong inverse association between resumption of sexual activity and cancer mortality that was seen in our study,” he said.

Gerber noted, however, that the relatively young age profile of participants, as well as the small number of women involved, may limit the strength of findings for older and female patients.

He also underlined that the study does not assume that sexual activity is the only factor that influences survival rates.

“Numerous physical and psychosocial health parameters are required for maintaining regular sexual activity,” he said. “In light of this, the net benefit of sexual activity itself is still a matter of debate.”

However, the results should show patients that they shouldn’t be worried about resuming sexual activity soon after a heart attack, Gerber concluded.

(Copyright (c) 2024 CNN. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox