Surviving a heart attack can kill your sex life.

But it doesn't have to, and a new study shows doctors play a key role in whether it does.

Patients were less likely to resume having sex if their doctors did not talk about when it was safe, the study found.

Many heart attack survivors fear that a tryst could land them back in the hospital - or even in the graveyard. But the chance of that is extremely small, doctors say.

"People perceive it might kill them. And it's not just the person with the heart attack, but also their partner," said Dr. Stacy Tessler Lindau, a gynecologist and sexuality researcher at the University of Chicago.

"If you can walk up two flights of stairs or do moderate exercise, then it's OK to have sex," she said.

Lindau led the study, the largest ever on this topic, and was to present results Friday at an American Heart Association conference in Washington.

It involved 1,184 male and 576 female heart attack survivors taking part in a bigger nationwide study, funded by the federal government. The average age was 60.

Less than half the men and only about a third of the women said advice about resuming sex was part of the instructions they got when leaving the hospital. Even fewer had that talk with their doctors over the next year.

One year after their heart attacks, more than two-thirds of the men and 40 percent of the women reported some sexual activity. They were 30 percent to 40 percent more likely to be having sex if they had talked with a doctor about it.

Men were more likely to be sexually active and married before the heart attack, and to maintain their sex life after it.

Some people actually reported more sex after their heart attacks, but this was the exception rather than the rule, Lindau said.

A heart attack should not keep people from enjoying sex, said Dr. Edward Havranek, a cardiologist at Denver Health Medical Center and leader of the Heart Association conference.

"The risk of having a heart attack during sex is really, really low," he said. "The amount of actual physical exertion people have during sex is actually lower than one might think. It's not as demanding as shoveling snow."

Doctors say it is safe to resume sex as soon as the patient feels better and can handle moderate exercise. Chest pain during sex means you should stop and consult a doctor, Lindau said.

Depression and mood swings are common after a heart attack and can dampen interest in sex, but this usually goes away within three months, says advice from the Heart Association.

It has these tips for resuming sex:

-Prepare by improving your physical condition and personal hygiene.

-Choose a time when you're rested, relaxed and free from daily stress.

-Wait one to three hours after eating a full meal.

-Pick a familiar, peaceful setting that's free from interruptions.