The federal Centers for Disease Control and Prevention said 28 people had been hospitalized with listeria infections across a dozen states.

At least two people have died and more than two dozen others have been sickened in an outbreak of listeria that appears to be connected to meat sliced at delis, according to the federal Centers for Disease Control and Prevention.

The fatalities were recorded in Illinois and New Jersey, the agency said. In all, 28 people across 12 states have been hospitalized with an infection of the bacteria Listeria monocytogenes since May, the C.D.C. said on Friday.

“Many people in this outbreak are reporting eating meats that they had sliced at deli counters,” the agency said, adding that the true number of people infected was most likely higher.

New York has reported the most cases at seven, followed by Maryland with six. States that have also reported cases include: Georgia, Illinois, Massachusetts, Minnesota, Missouri, New Jersey, North Carolina, Pennsylvania, Virginia and Wisconsin.

Patients who gave samples that tested positive for the bacteria between May 29 and July 5 were 32 to 94 years old, including one pregnant person who recovered, according to the investigation.

The C.D.C. said public health investigators were using a national database of DNA fingerprints of bacteria that cause food-borne illnesses to identify specific products that had been contaminated.

DNA fingerprinting is performed on bacteria using a method called whole genome sequencing, which showed that bacteria from samples of those infected were closely related genetically, suggesting that people became ill from eating the same foods.

The U.S. Department of Agriculture’s Food Safety and Inspection Service was working to identify the suppliers of meats, sliced at deli counters, purchased in the outbreak.

“Listeria spreads easily among deli equipment, surfaces, hands and food,” the C.D.C. said. “Refrigeration does not kill Listeria, but reheating to a high enough temperature before eating will kill any germs that may be on these meats.”

The agency said that it had no evidence of listeria bacteria infections tied to prepackaged deli meats.

Listeria bacteria, which are naturally found in soil, can contaminate many foods. When ingested, they are most harmful to people who are pregnant, people who are at least 65 years old or those who have weakened immune systems.

Listeria infection is the third leading cause of death from food-borne illness in the United States, according to the C.D.C.

Possible symptoms from an infection include fever, muscle aches and tiredness. Listeria can cause pregnancy loss, premature birth and life-threatening infections in newborns. For people who are 65 years or older, or with a weakened immune system, listeria often results in hospitalization and sometimes death.

Public health authorities in Canada this month reported that two people had died from listeriosis after consuming plant-based alternatives to dairy milk. In June, dozens of ice cream products were recalled by the manufacturer Totally Cool after the Food and Drug Administration warned of possible listeria contamination.

In 2023, several listeria outbreaks were reported, including ones tied to leafy greens, ice cream and peaches, nectarines and plums.