A maverick farmer at the heart of the debate over raw milk has pleaded guilty to illegally selling the controversial dairy product as well as peddling food without a proper license.

Mike Hartmann pleaded guilty in Sibley County District Court on Monday to two misdemeanor counts and was fined $585 and put on unsupervised probation for six months. Under terms of his probation, Hartmann -- who has a history of battling state regulators -- has to get his barn in order or possibly go to jail.

As part of his plea bargain, Hartmann is to comply with all state food licensing and labeling laws within 60 days, said Don Lannoye, assistant Sibley County attorney. "The [state] Agriculture Department will be making contact with him and seeing what his game plan is for the future."

Hartmann, who was slated for trial on Nov. 13, couldn't be reached for comment. As part of his plea, six other misdemeanor counts against him were dismissed, as was one gross misdemeanor.

Also, charges were dropped against his wife, Diane Hartmann, his brother Roger Hartmann and Linda Schultz, all of whom were alleged to have abetted the illegal sale of raw milk and other food products.

A 2010 outbreak of E. coli O157:H7 traced to Hartmann's Gibbon dairy farm put a spotlight on a national controversy over raw, or unpasteurized, milk, which is not heat-treated to kill pathogens.

Public health authorities warn against consumption of unpasteurized dairy goods, and many state laws limit their distribution. In Minnesota, raw milk can be sold only on the farm where it's produced.

But a small, yet growing, natural foods movement sees nutrition benefits to raw milk, thus creating a market for unpasteurized dairy products. So raw milk has made its way from Minnesota farms, including Hartmann's, into ad hoc distribution networks in the Twin Cities.

Another Minnesota farmer, Alvin Schlangen, was cleared of violating state raw milk laws last month by a Hennepin County jury. Schlangen, an organic egg farmer from Freeport, northwest of St. Cloud, didn't produce the milk himself, but bought it from an Amish farm.

He then distributed it to members of a private food club, including at a south Minneapolis natural foods outlet. Schlangen was charged in 2010 in the wake of an investigation into Hartmann by the Minnesota Department of Agriculture.

In spring 2010, state health and agriculture inspectors linked eight cases of E. coli O157:H7 to raw milk from Hartmann's farm. The foodborne bug leads to vomiting, diarrhea and other nastiness, and can cause death.

Owen Caldwell, a 2-year-old who allegedly drank Hartmann's milk, was hospitalized for 13 days with a condition that can cause kidney failure. His father, Matthew Caldwell, has sued Hartmann in Hennepin County for product liability, seeking more than $50,000 in medical costs.

Hartmann, who has a loyal following among raw milk and natural food partisans, has long denied his products caused sickness.

After the outbreak, he also rejected the state Agriculture Department's contention that his dairy operation was unsanitary. In a civil proceeding last year, District Judge Rex Stacey agreed with the state.

Long before the raw-milk flap, Hartmann wrangled with state inspectors over livestock issues, meat sales and milk production.

Now, the Agriculture Department will monitor Hartmann's compliance with the plea bargain, Lannoye said. If Hartmann doesn't comply, "it's likely we will ask for jail time."

Mike Hughlett • 612-673-7003