A waste incinerator has been voluntarily shut down after breaching its limit for emissions.
Environment Agency Wales said it was taking legal action against the council-owned plant at Crymlyn Burrows in Neath Port Talbot.
Officers said it had failed five out of 10 dioxin emissions tests since the summer although breaches were not at levels to cause health problems.
The plant's operators said they were working to address the issue.
The plant, which opened in 2002, processes household waste for recycling and incineration from Neath Port Talbot and Bridgend.
It is operated by Neath Port Talbot (Recycling) Ltd - a wholly-owned subsidiary of the council.
The agency has issued an enforcement notice that will require the operators to take steps by a set date to improve emissions from the site.
The incinerator has been voluntarily shut down until mid January as investigations continue.
The agency said Public Health Wales had confirmed the breaches were not at a level to cause health problems to local people.
But the agency's area manager Steve Brown said: "This situation has gone on too long.
"Out of the 10 dioxin results received since the summer, five of these have been over the permitted limit and this is unacceptable.
"Public Health Wales have reassured us that the levels of these breaches do not pose a risk for local people but are concerned if the situation was to continue.
"We set the permit limits to protect people and the environment and this is why we, as regulators of the site, have escalated our action.
"The company have done everything we have asked of them so far, but we will not stop our action until the site is back into compliance with its permit."
Will Watson, a director of Neath Port Talbot (Recycling) Ltd, said: "We took a decision to temporarily close the plant for planned maintenance work two weeks early in light of the recent dioxin results."
He said the plant was addressing the failed test results but they had to be put in context.
"The level of emissions which we have recorded are still well below the levels which are permitted for other industries by the Environment Agency for dioxin emissions," he added.