General Mills Inc. has recalled 1.8 million boxes of gluten-free Cheerios because they accidentally contained wheat flour, a major gaffe as the packaged food giant is counting on the new, wheatless Cheerios to rejuvenate sagging cereal sales.

The voluntary recall on Monday includes four days of production of Cheerios and 13 days of production of Honey Nut Cheerios, both made at the company’s Lodi, Calif., cereal plant during July.

“I am embarrassed and truly sorry to announce today that we are recalling boxes of Cheerios and Honey Nut Cheerios,” Jim Murphy, the head of General Mills’ U.S. cereal business, wrote on a company blog. “In an isolated incident involving purely human error, wheat flour was inadvertently introduced into our gluten-free oat flour system in Lodi.”

General Mills began investigating its production system there after becoming “aware of illness complaints from gluten intolerant consumers,” the company said in an e-mail. “Two complaints of illness have been reported directly to General Mills related to the affected products.”

General Mills said the U.S. Food and Drug Administration also became aware of illness complaints. The FDA on Monday did not have an immediate response.

People with celiac disease cannot eat gluten, a protein in wheat. Celiac sufferers make up about 1 percent of the population, though about 7 percent — while not diagnosed with celiac — have digestive systems that are intolerant of gluten.

The recall of Cheerios labeled “gluten-free” is what’s known as a “Class I” recall, meaning there is reasonable probability that it will cause serious health consequences.

Even though Cheerios are made primarily of oats, which naturally contain no gluten, the cereal manufacturing process can still let through small amounts of gluten. The foul-up in Lodi, Calif., occurred when the plant lost rail service and its gluten-free flour was transferred from rail cars to trucks, General Mills said in a news release.

The company said it had tested its oat supply and its oat flour, and both met the FDA standard for gluten-free. General Mills makes oat flour at its mill in Fridley and then ships it to cereal plants in California and four other states.

The gluten-free food market has boomed the last four years, not only because of a growing awareness of gluten intolerance, but because of a growing belief (though evidence is scant) that a wheat-free diet leads to better health. General Mills reformulated Chex in 2008, and since then Chex has been one of its hottest cereal brands.

In February, the company announced that five iterations of Cheerios — Apple Cinnamon, Multigrain, Frosted, Honey Nut and original — would go gluten-free. Together, they make up about 90 percent of Cheerios sales. Cheerios is the nation’s best known cereal brand, and Honey Nut Cheerios has been the top selling U.S. cereal in recent years.

General Mills began shipping gluten-free Cheerios to grocery stores last summer and plans a major marketing initiative for later in the fall. In an earnings conference call with analysts last month, a General Mills senior vice president said that “gluten-free Cheerios will be one of the largest merchandising events in our cereal business’ history.”

But the recall could be a blow to gluten-free Cheerios.

“People with celiac disease, they are not going to eat it for a while,” said Ted Labuza, a food safety expert at the University of Minnesota. “That could be damaging to income.”

The U.S. cereal business, which is dominated by General Mills and Kellogg, has seen declining sales in recent years as consumers have gravitated to other breakfast options. General Mills is betting on new product innovations to reel them back.

The Cheerios recall is the second recall for General Mills in the last week and the third in less than two months.

Friday, General Mills recalled 60,000 bags of its Cascadian Farms frozen green beans after one package tested positive for listeria. In late August, the company also recalled some Cascadian Farms green beans for the same reason. No illnesses were reported associated with the recall.

Listeria causes listeriosis, a serious infection with symptoms including fever and gastrointestinal problems.