The substance, called acrylamide, forms when carbohydrates are heated such as by baking bread or frying potatoes, researchers claimed.
The National Food Administration studied more than 100 foods and determined that "fried, oven-baked and deep-fried potato and cereal products may contain high levels of acrylamide."
"The discovery that acrylamide is formed during the preparation of food ... is new knowledge," researcher Leif Busk said. "It may now be possible to explain some of the cases of cancer caused by food."
Swedish researchers estimated acrylamide could be responsible for several hundred of the 45,000 cancer cases in Sweden each year, based on experiments in which rats were fed fried food.
They declined to identify a specific type of cancer that could be caused by acrylamide, saying further study was needed.
Nevertheless, researchers did not quantify the apparent cancer risk and health officials didn't issue any guidelines on what or how much to eat.
"Do not stop eating these foods, but beware of what you eat, eat more cooked food, more vegetables," said Lilianne Abramsson Zetterberg, a toxicologist with the government agency.
The U.S. Environmental Protection Agency describes acrylamide as white, odorless, flake-like crystals that are used mainly in treating drinking water and for industrial purposes. It can cause cancer in people exposed to high levels for a long period.
Two of Sweden's national newspapers reported the story on their front pages Tuesday ahead of the food agency's news conference, which was televised live to an interested, apparently nervous public. So many people tried to log onto the agency's Web site that it temporarily shut down.
"I see this alarm as one among many," said Eva Buren, a spokeswoman for the grocery chain ICA. "Most of us know already that you should not eat a bag of chips a day."
Swedish researchers said they believed their studies were the first to look at its creation and consumption in food.
The food agency said its data confirmed similar findings by researchers at Stockholm University.
Findings were being submitted to the 15-nation European Union for further study.