Sydney Water has been fined $269,500 for two overflow events that led to millions of litres of untreated sewage flowing into Botany Bay, creating "a potential risk" to those exposed to the effluent.

The Land and Environment Court convicted the utility on three offences related to the overflows from an outlet into Mill Stream during scheduled maintenance works in May and June 2017.

The EPA said the leakage of untreated sewage two years ago created a potential risk to those exposed to water in parts of Botany Bay. Credit:James Alcock

The first uncontrolled release totalled up to 334 million litres of sewage and the second about 173 million litres. Sydney Water pleaded guilty to the charges.

Mark Gifford, acting chief executive of the NSW Environment Protection Authority, said Sydney Water failed to carry out sewage treatment "in a competent manner", with water users at Foreshore Beach particularly exposed.