After a water main break, who pays for damage – the city or its residents?

When a city water main breaks and sends water flooding into homes and businesses, someone must take care of the mess. But who is responsible for paying for the damage: the city, or its residents?