The warning came just as millions of Americans were preparing for the biggest food holiday of the year. People should not buy or eat romaine lettuce; restaurants should stop serving it; anyone who has it on hand should throw it out and clean the refrigerator immediately.

The stern and sweeping advisory, issued by the Centers for Disease Control and Prevention on Tuesday afternoon, two days before Thanksgiving, caught many people off guard. But the agency said it was acting out of an abundance of caution after 32 people in 11 states fell sick with a virulent form of E. coli, a bacteria blamed for a number of food-borne outbreaks in recent years.

“If you do not know if the lettuce is romaine or whether a salad mix contains romaine, do not eat it and throw it away,” the C.D.C. statement said. “Wash and sanitize drawers or shelves in refrigerators where romaine was stored.”

Officials said such measures were necessary while they track down the source of the contamination, and at the moment all they could say was that investigators believe the tainted lettuce was grown or processed in Canada or the United States.