A federal health panel, warning that 40 million Americans have cholesterol levels placing them at high risk of heart disease, called on doctors yesterday to prescribe strict diets and, in some cases, drug treatment for those at risk.

The guidelines, aimed at identifying adults who need medical treatment to decrease their cholesterol, establish the first specific recommendations to physicians for treating persons with high cholesterol levels. They also create a single set of blood-cholesterol goals for all adults, regardless of age or sex.

"If doctors follow the guidelines, medical practice will undergo a major change as a result of this report," said Dr. DeWitt S. Goodman, professor of medicine at Columbia University and chairman of the federal committee. "It will have a lasting impact on coronary heart disease and public health in the United States."

About 1.5 million Americans suffer heart attacks each year, and 500,000 of them die, according to the National Institutes of Health. Officials said yesterday that strict adherence to the new guidelines could save 300,000 lives annually.

The report urges that all Americans undergo cholesterol testing. Large amounts of cholesterol can lead to heart disease by causing fat to accumulate on artery walls, blocking the flow of blood that normally nourishes the heart muscle.

The report, issued by the National Heart, Lung and Blood Institute, states that about 25 percent of Americans between ages 20 and 74 have high blood cholesterol and need treatment.

The panel set a new standard for measuring cholesterol in adults over age 20, after years of guidelines based on age and sex.

The report set three classifications, saying those with total blood cholesterol of 240 milligrams or more per deciliter of blood have "high blood cholesterol," those who measure between 200 and 239 have "borderline high blood cholesterol" and those registering below 200 have "desirable blood cholesterol."

Doctors on the panel stressed that dietary treatment should be the foundation of all therapy to reduce blood-cholesterol levels and urged physicians to prescribe drugs only for those with severely elevated cholesterol or those whom diet therapy fails to help.

"There is little instruction about diet therapy in our medical schools," Goodman said. "Busy doctors prefer using drugs, but nutritional treatment should be used for the vast majority of patients, and drug treatment should be used only when all else fails."

Several drugs on the market are quite effective in lowering cholesterol levels. But to prove beneficial, drug treatment must last for years, if not for life, the panel noted. Therefore, doctors have urged caution on long-term use of new drugs such as lovastatin.

The report called lovastatin, approved for use last month, "a major advance," but doctors on the panel also wrote that "long-term safety" has not been established.

The panel cited several risk factors that should be considered when physicians decide on treatment. Among them are being male, obesity, cigarette smoking, high blood pressure or having a family history of premature heart disease.

The report urges that those with two risk factors have their blood tested to determine more specifically their levels of the type of cholesterol known as low-density lipoprotein, or LDL. High levels of LDL can lead to heart disease by causing fat to attach itself at artery walls.

Another form of cholesterol, called high-density lipoprotein, or HDL, protects against heart disease by removing fat from the arteries.

LDL tests are rarely given, and the new recommendations are expected to increase them. The report said LDL levels of 130 to 159 are classified "borderline high-risk cholesterol," while levels of more than 160 are considered "high-risk."

Officials said yesterday that the quality of cholesterol tests nationwide can vary greatly between laboratories.

"We need to present a standard that labs can use to measure cholesterol," said Herbert K. Naito, a panel member who studied testing standards. "Huge screening programs will call upon us to present more accurate test results."

He said that, for now, people should have two tests, separated by about a month. If the results vary by more than 5 percent, a third should be taken and the results averaged, he said.

The panel said doctors should prescribe diet therapy in two stages. In the first, the patient should consume no more than 30 percent of his or her total calories in fat, with no more than 10 percent of them in saturated fat and fewer than 300 milligrams a day in dietary cholesterol.

The second phase would require a greater reduction in saturated fats and cholesterol.