Dean Foods Co, the largest U.S. milk processor, withdrew its full-year profit forecast, saying raw milk prices remained "unpredictable and volatile."

The company's shares fell 10 percent before the bell, after it also reported a bigger-than-expected second-quarter loss.

In the quarter, U.S. raw milk prices rose 6 percent from the first quarter and 31 percent from a year earlier to a record high of $23.66 per hundred-weight.

"The second quarter was even more challenging than we had originally anticipated," Chief Executive Gregg Tanner said in a statement on Monday. "This is by far the most difficult operating environment in the history of the company."

Milk prices have been rising in the United States since 2008, when China started sourcing foreign-made milk powder and infant formula after six babies died and over 300,000 children fell ill due to local milk products contaminated with melamine.

Years of drought in parts of the United States have also shrunk cattle herds to the lowest level in more than six decades.

Dean Foods has been struggling to boost volumes amid tough competition and volatile commodity prices after losing a contract with Wal-Mart Stores Inc last year.

The Meadow Gold and Dean's Milk maker has been trying to lower costs by closing factories and cutting jobs. In May, the company cut its adjusted profit forecast for 2014.

Dean Foods forecast an adjusted loss of 5-15 cents per share for the third quarter ending September.

The company's net loss narrowed to $1 million, or 1 cent per share, in the second quarter ended June 30 from $57 million, or 61 cents per share, a year earlier, when the company posted a big loss from discounted operations.

Dean Foods sold its Morningstar division, which sells coffee creamers, ice cream mixes and other dairy products, to Canadian dairy products maker Saputo Inc in January 2013.

Excluding items, Dean Foods reported a loss of 14 cents for the second quarter.

Net sales rose 7 percent to $2.39 billion.

Analysts on average had expected a loss of 6 cents per share on revenue of $2.32 billion, according to Thomson Reuters I/B/E/S.

Dean Foods' shares closed at $15.81 on the New York Stock Exchange on Friday. The stock has fallen 23 percent in the 12 months to Friday's close.