A WestConnex contractor has been fined $445,000 for “causing an offensive odour”.

The NSW Land and Environment Court has convicted CPB Contractors for failing to properly manage the pungent smells emitted out of its Sydney construction site.

CPB must pay $295,000 to the Environmental Trust instead of a fine and $150,000 to the NSW Environment Protection Authority (EPA) for investigative and legal costs.

The court action came after the EPA received and investigated hundreds of community complaints relating to odours from the St Peters M5 interchange in Sydney's inner-west.

Residents reported a “rotten egg, farty smell”, according to the ABC, while another said the smell was so bad it almost made her vomit. A third was led to believe her colostomy bag had broken, causing “considerable embarrassment”.

The EPA says the odour came from untreated leachate — waste mixed with water — or contaminated water pooling at the interchange site.

“[It] caused substantial harm to the community and impacted human health,” EPA regional director metropolitan Giselle Howard said.

“The odours or smells that came off the construction site were causing physical pain so people were feeling ill.

“They had breathing difficulties including asthma attacks and felt nauseous so it was really awful for these communities.”

She said CPB acknowledged in court that the harm was foreseeable.

The construction was occurring over an old tip site, releasing the emissions when the builder excavated contaminated rainwater.

CPB pleaded guilty to four offences of “emission of offensive odour” from the construction site, and has been ordered to send a letter of apology to residents in the area.

The contractor also has to publish details of the offences in the Australian Financial Review, the Sydney Morning Herald and the Inner West Courier and on their social media and website.