Facing a long-term water crisis, officials concerned with preserving a reservoir in Los Angeles hatched a plan: They would combat four years of drought with 96 million plastic balls.

On Monday, Mayor Eric Garcetti of Los Angeles arrived at the 175-acre Los Angeles Reservoir to release the final installment of the project: 20,000 small black orbs that would float atop the water.

The scene resembled something found at a playground — “You turned the reservoir into the world’s largest ball pit? #bestmayorever,” wrote one supporter on the mayor’s Facebook page — but the initiative has serious implications for the city’s water supply.

Mr. Garcetti said that the dark balls would help block sunlight and UV rays that promote algae growth, which would help keep the city’s drinking water safe. Officials also said the balls would help slow the rate of evaporation, which drains the water supply of about 300 million gallons a year. The balls cost $0.36 each and are part of a $34.5 million initiative to protect the water supply.