LOS ANGELES — The rupture of a nearly century-old water main that ripped a 15-foot hole through Sunset Boulevard and turned a swath of the University of California, Los Angeles, into a mucky mess points to the risks and expense many cities face with miles of water lines installed generations ago.

The flooding sent more than 20 million gallons cascading from a water main in the midst of the California’s worst drought in decades and as tough new fines took effect for residents who waste water by hosing down driveways or using a hose without a nozzle to wash their car.

Much of the piping that carries drinking water in the country dates to the first half of the 20th century, with some installed before Theodore Roosevelt was in the White House.

Age inevitably takes a toll. There are 240,000 breaks a year, according to the National Association of Water Companies, a problem compounded by stress from an increasing population and budget crunches that slow the pace of replacement.

“Much of our drinking water infrastructure is nearing the end of its useful life,” the American Society of Civil Engineers said in a report last year, noting that the cost of replacing pipes in coming decades could exceed $1 trillion.

The association of water companies says nearly half of the pipes in the U.S. are in poor shape, and the average age of a broken water main is 47 years. In Los Angeles, a million feet of piping has been delivering water for at least 100 years.

The 30-inch pipe that burst Tuesday near UCLA shot a 30-foot geyser into the air that sent water down storm drains and onto campus, flooding the school’s storied basketball court less than two years after a major renovation. The pipe was still gushing 1,000 gallons a minute Wednesday and officials said repairs could take two more days.