WASHINGTON — Heart-clogging trans fats have been slowly disappearing from grocery aisles and restaurant menus in the last decade. Now, the Food and Drug Administration is finishing the job.

The FDA planned to announce Thursday it will require the food industry to gradually phase out all trans fats, saying they are a threat to people’s health. Commissioner Margaret Hamburg said the move could prevent 20,000 heart attacks and 7,000 deaths each year.

Hamburg said that while the amount of trans fats in the country’s diet has declined dramatically in the last decade, they “remain an area of significant public health concern.” The trans fats have long been criticized by nutritionists, and New York and other local governments have banned them.

The agency isn’t yet setting a timeline for the phase-out, but it will collect comments for two months before officials determine how long it will take. Different foods may have different timelines, depending how easy it is to find a substitute.

“We want to do it in a way that doesn’t unduly disrupt markets,” says Michael Taylor, FDA’s deputy commissioner for foods. To phase them out, the FDA said it had made a preliminary determination that trans fats no longer fall in the agency’s “generally recognized as safe” category, which is reserved for thousands of additives that manufacturers can add to foods without FDA review. Once trans fats are off the list, anyone who wants to use them would have to petition the agency for a regulation allowing it, and that would be unlikely to be approved.

Trans fats are widely considered the worst kind for your heart, even worse than saturated fats, which can also contribute to heart disease. Trans fats are used both in processed food and in restaurants, often to improve the texture, shelf life or flavor of foods. They are created when hydrogen is added to vegetable oil to make it more solid, which is why they are often called partially hydrogenated oils.

Scientists say there are no health benefits to trans fats and say they can raise levels of so-called “bad” cholesterol, increasing the risk of heart disease — the leading cause of death in the United States.

Many companies have already phased out trans fats.

Though they have been removed from many items, the fats are still found in processed foods, including in some microwave popcorns and frozen pizzas, refrigerated doughs, cookies and ready-to-use frostings. They are also sometimes used by restaurants that use the fats for frying. Many larger chains have phased them out, but smaller restaurants may still get food containing trans fats from suppliers.