A Chinese dairy company has recalled hundreds of cartons of milk after a mechanical error tainted the batch with alkaline water, the latest blow to China's scandal-plagued dairy industry.

The recall comes just weeks after China's top-selling dairy firm, Inner Mongolia Yili Industrial Group Co, pulled six months' worth of infant formula from shelves due to mercury contamination.

China's milk industry is struggling to restore consumer confidence after a series of scandals, the worst of which was in 2008 when milk and infant formula laced with the industrial chemical melamine killed at least six children and made nearly 300,000 ill.

In the latest incident, the Bright Dairy & Food Co., called Guangming in Chinese, posted a recall notice on its website after customers complained online of bad smelling and discolored liquid in the company's 950 ml cartons (about a quarter gallon) of Ubest milk, state media reported on Thursday.

A seconds-long mechanical delay during routine maintenance at one of its Shanghai factories caused a "small amount" of alkaline cleaning solution to be flushed into 300 cartons of milk produced on Monday, the company's notice said.

"We deeply apologize for any impact this has had on our customers. From today on, we will strictly strengthen relevant management procedures," it said, thanking media and customers for their "supervision".

Bright Dairy said it would provide door-to-door apologies to customers who bought the bad milk and carry out a strict factory inspection.

The Shanghai Bureau of Quality and Technical Supervision said it was investigating the case.

China has struggled to rein in health violations in the unruly and vast food sector despite harsh punishments and repeated vows to deal with the problem.

The country is notorious for its food safety woes, with frequent news reports of fake cooking oil, tainted milk and even watermelons that explode from absorbing too much fertilizer.