Not far from Latin America's biggest city, Sao Paulo, a river is covered in a white layer that resembles fresh snow but is in fact a smelly, toxic foam.

The Tiete river, some 1,100 kilometers long, is crucial for potable water, irrigation and energy production in southeast Brazil, the country's most populated area.

But parts of the waterway, including one area just 100 kilometers (62 miles) from the metropolis, have been befouled by phosphate and phosphorus residues from household detergents used by Sao Paulo's 22 million inhabitants and washed down the sewers.

A tributary of the Parana river, the waterway has been covered in a visible foam layer since last week, at one point spread over more than 10 kilometers and also spotted blighting several waterfalls.

"When these residues enter the fast-running waters of the Tiete, it is as if a washing machine has been turned on," said Malu Ribeiro of the NGO SOS Mata Atlantica, describing the foamy mess.

The NGO warns that fumes from the foam can cause sore throats and breathing problems, and contact could irritate the skin.

The impact on animal and plant life was likely similar to that caused by "acid rain," said Ribeiro.

The phenomenon is not a new one: The foam is a frequent feature of the river in the dry winter months when there is less water to dissolve the chemicals.

In the 1990s, the situation was sometimes so bad that the foam ran down the streets of some cities near the river's shore.

Improvements to water treatment have alleviated the problem, but some years are still worse than others.

Ribeiro said the foam is worse in periods with big temperature fluctuations. In winter the contrast can be quite extreme, with very cold mornings and very hot afternoons.

"Cold water is heavier, and it carries polluting residues to the bottom... But when it is heated by the sun, these residues rise to the surface and form a thicker foam," she explained.

SOS Mata Atlantica is advocating for a ban on phosphate and phosphorus in domestic cleaning products.

Water treatment must be improved too: In the Alto Tiete basin that serves Sao Paolo, just over half of wastewater is treated, according to official data from 2021.

Sao Paulo's environment secretariat has promised to invest 5.6 billion reais (about $1.1 billion) in the water treatment network by 2026.