A federally financed study of 12,866 men -- half exhorted to improve their health habits and half getting only "usual care" from their doctors--has produced an unexpected result:

Both groups had the same rate of heart attacks, but it was only one-fourth the rate of the general population of the same age.

Only 1 1/2 percent of all 12,866 men in the study died of heart attacks, while 6 percent of the average American male population 35 to 57 years old would be expected to succumb to heart disease during the same period.

What happened, according to researchers at the National Heart, Lung and Blood Institute, is that during the 1970s, when the study was conducted, almost all Americans were reading and hearing advice to smoke less, eat fewer fats and lower their cholesterol level and blood pressure.

And they were lowering their incidence of heart disease sharply.

Exhorted or not, most of the men in the study and their doctors apparently got the same message, and did even better than the average American.

This was one of the main conclusions as a group of leading heart doctors, the directors of the $115 million study, presented their results yesterday.

Despite the study's surprising results, the main message, said Dr. Oglesby Paul of Harvard University, is "Smokers should quit. Hypertensives should seek medical care and lower their blood pressure. Those with elevated cholesterol should reduce it."

Paul headed the steering panel for this "MRFIT," for "Multiple Risk Factor Intervention Trial," project.

All 12,866 men in 18 cities recruited for the trial were "high-risk" individuals. They were smokers, had moderately high blood cholesterol or moderately high blood pressure or had two or all three of these known risk factors, though they were all apparently healthy.

Starting in 1972-73, half were assigned to a "special intervention" group. They were seen at first weekly, then every four months, and were given help and training in health habits, smoking cessation and diets. The rest of the men, the "usual care" group, got only an annual physical.

But the annual physical and the changing cultural and medical climate had effects. After six years:

* Both groups cut their expected heart attack rate in half, from 3 to 1.5 per 100 men. In numbers, the special intervention group had 115 heart attacks, while the usual care group had 124, statistically not significant.

* The first group lowered its cholesterol and blood pressure levels more than the second, but both lowered them.

* At the start, 64 percent of both groups smoked cigarettes. By the end 32 percent of the first group and 46 percent of the second smoked.

* Perversely, the results on lowering blood pressure weren't as clear. Though an improvement was found in a large share of the men, there was a high fatal heart attack death rate in one group: those who had abnormal electrocardiograms and were taking anti-hypertension drugs.

It may be, one doctor said, that they were at higher risk because they had some previously unsuspected heart damage. However, Dr. Paul said, the finding raises questions that need answers about drug use.