Exercise helps people recover after a heart attack but the benefits vanish when the workouts stop, Swiss researchers said on Monday.

Blood vessel function improved after four weeks of exercise among people who exercised, but the findings published in the journal Circulation suggest that long-term and continuing physical activity is key to preventing another heart attack.

The Swiss team looked at 209 people who had survived a heart attack to gauge the effects of different types of exercise and what happened when people stopped regular physical activity.

Volunteers were assigned to receive training in aerobic exercise, resistance workouts to build strength, a combination of the two, or no exercise at all.

After four weeks, blood vessel function in the three exercise groups improved regardless of the type of exercise, the researchers said. There were no improvements among the men and women who did not work out.

The researchers also asked some people in the exercise groups to stop physical activity. They found that after one month all the positive benefits of working out had vanished.

"This aspect is particularly important in patients with coronary heart disease," Margherita Vona of the Clinique Valmont-Genolier in Montreux, who led the study, said in a statement.

Heart disease — the world's leading cause of death — is caused by fatty deposits that harden and block arteries, high blood pressure which damages blood vessels, and other factors.

Doctors know that exercise improves heart function but how much and what type of exercise people should take after a heart attack is unclear, Vona said