(Reuters) - Top U.S. dairy company Dean Foods Co (>> Dean Foods Co) said it would close up to 15 percent of its factories in the face of increasing competition and falling volumes, as it reported a quarterly loss and warned of more tough times ahead.

Shares of Dallas-based Dean, known for its Meadow Gold and Dean's milk, fell as much as 9 percent after it said that the current quarter would be the most challenged this year.

The company said it plans to close eight to 12 of its factories by the middle of next year to cut costs as milk volumes fall.

"We have accelerated the severance including our plans to close 10 to 15 percent of our plants...we expect these efforts to offset the volume deleverage," Chief Executive Gregg Tanner said on a conference call with analysts.

Dean Foods is the largest processor and distributor of milk in the country. It says it is about five times the size of its next largest competitor.

Tanner said the fluid milk category volume this year will likely be a bit softer than the company had previously anticipated.

In February the company said the loss of a significant customer would lead to a low-single digit percentage decline in 2013 milk volumes.

Dean reported a net loss of $56.9 million, or 30 cents per share, on an attributable basis for the quarter ended June, compared with a profit of $56.2 million, or 30 cents per share, a year earlier.

On an adjusted basis, it earned 13 cents per share from continuing operations. Analysts on average were expecting a profit of 14 cents per share on revenue of 2.25 billion.

Dean forecast a third-quarter adjusted profit between 5 and 8 cents per share, below the average estimate from analysts of 11 cents per share, according to Thomson Reuters I/B/E/S.

The company said it now expects full-year adjusted earnings between 47 cents and 53 cents per share.

Dean Foods' fluid milk volumes fell 6 percent in the quarter, a sharper fall than the 2.1 percent fall across the industry.

It said its share of U.S. fluid milk sales volume declined to 36.4 percent during the second quarter from 37.8 percent in the first quarter of 2013.

Revenue was flat at $2.2 billion.

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

The company recently disposed of the last of its stake in WhiteWave Foods Co (>> WhiteWave Foods Co), which owns brands such as Silk soy milk, International Delight and Land O Lakes coffee creamers.

Dean shares traded as low as $10.01 on the New York Stock Exchange on Thursday morning before recovering a little to $10.21. They had risen as much as 25 percent this year.

(Editing by Sriraj Kalluvila and Rodney Joyce)

By Aditi Shrivastava

Stocks treated in this article : Dean Foods Co, Saputo Inc., WhiteWave Foods Co