Controversial plans to build a US-style mega pig-farm in South Derbyshire suffered a setback on Tuesday night after the local council refused to back the scheme.

Its failure to be approved at local level is a blow to the proposed development as it moves on to its most important and critical final hurdle – consideration by Derbyshire county council – at a meeting likely before the end of the year.

Midland Pig Producers (MPP) has applied for permission to build the farm – which could house up to 25,000 animals – on a greenfield site west of the historic village of Foston and adjoining a women's prison.

But at a public meeting last night, members of the planning committee of South Derbyshire district council – in its role as a consultee – voted by a majority not to back the scheme.

A spokesperson for MPP said on Tuesday night that it was not the death-knell for the scheme. "Disappointingly, in making their decision, members of the planning committee decided to ignore the recommendation of the professional planning officers. The report considered by the planning committee recommended no objection. However, the final decision is not the gift of SDDC."

She went on: "The SDDC's decision will of course be included in Derbyshire county council's deliberations, but the final outcome is not dependent on one, albeit important, consultee. We are aware that a handful of local people are opposing the plans, but the vast majority of those objecting are not local residents. As we have pointed out previously, we have never expected to have the support of those activists who do not eat meat.."

During the twists and turns of the planning application, it has attracted huge opposition – 13,000 objections and and 10,000 signatories to an online national petition – as well as criticism from celebrity opponents. In addition to human health concerns raised by government health officials, farming campaign groups such as the Soil Association and Friends of the Earth have warned it will herald the beginning of bigger factory farming projects in the pig, poultry and dairy sector.

The protest group Pig Business said it was "delighted" that councillors had listened to constituents: "We hope that the county council will follow their recommendation and refuse to open the floodgates to mega pig-farming in the UK.

Jim Davies, a local resident and member of Foston Community Forum who attended the meeting said that his reaction was that of "utter relief, particularly for local families who would be closely affected by the development".

Peter Melchett, Soil Association's policy director, said: "We are pleased that South Derbyshire district council have listened to concerns about the risks to health this proposal poses, which have been put forward by large numbers of local residents and the government's independent advisory body on health issues."

Last week the scheme received a boost after the Environment Agency withdrew its earlier objections. The agency had initially opposed the plans, because of concerns about water pollution, but changed its position after being assured by the company that there would be no problems and because any adverse impact could be controlled or mitigated.

However, government health officials also told the local council they have public health concerns about air pollution from the farm. A letter from the Health Protection Agency to the SDDC this week said: "Those living up to 150m downwind of an intensive swine farming installation could be at risk of adverse human health effects associated with exposure to multi-drug resistant organisms."

It also said the planning application for the pig farm did not provide enough information about the risks to the public from emissions of ammonia gas from livestock and slurry, of bioaerosols (airborne particles containing living organisms, fragments and toxins) from the farm or emissions from the biogas plant.

But MPP claims that any odours from the farm will be prevented from escaping.

The protest against the development has received the backing of celebrities such as the actor Dominic West – who grew up in the area – comedian and TV presenter Paul O'Grady and stars of the rural soap Emmerdale including Roxanne Ghawam-Shahidi, Lucy Pargeter and Charley Webb. Michael Mansfield QC, wrote to Derbyshire county council in the summer registering his objection to the farm.

MPP is one of the largest pig production companies in the UK, producing over 100,000 pigs each year from 30 farms in eight counties and employing over 150 people. It promises that at least 20 jobs will be created and throughout the local area as associated contracts are fulfilled.