Just after 5 a.m. on August 30, water began flooding a vast underground chamber called the "cathedral" in Saitama Prefecture. The gushing water, captured by security cameras, was the rain that was drenching the capital region as Typhoon Shanshan lashed southwest Japan, 600 km away.
The cathedral and its vast network of tunnels did their job: they prevented a vulnerable river basin in the metropolis from flooding. But as global warming causes more severe weather, authorities are having to give the system a major upgrade.
"As the temperature rises, the amount of water vapor in the atmosphere increases, resulting in relatively larger quantities of rainfall," said University of Tokyo professor Seita Emori, who is a member of a climate science group that won a Nobel Prize in 2007.
"We anticipate that previously unseen amounts of rain will fall as the temperature rises in the future," he added.
Japan is prone to numerous natural disasters, from earthquakes and volcanic eruptions to typhoons and landslides. And like much of the world, the nation is dealing with unprecedented weather due to global warming.
This summer was the hottest ever since records began in 1898, while record rainfall in northern regions resulted in disastrous flooding in July, according to the weather agency. In Tokyo, sudden, violent storms known as "guerrilla" showers have become increasingly common.
The cathedral complex, officially called the Metropolitan Outer Area Underground Discharge Channel, took 13 years and 230 billion yen to build. Since coming online in 2006, it has already prevented more than 150 billion yen in flood damage, the land ministry estimates.
In addition to its engineering ingenuity, the complex is a popular tourist spot and filming location. The cavernous expanse has the capacity to hold the water in almost 100 Olympic-sized swimming pools.
Inside are 59 massive pillars, each weighing 551 tons and stretching 18 meters tall. When nearby rivers flood, the overflow courses through 6.3 km of massive underground tunnels before collecting in the reservoir.
Descending about six floors to the bottom of the chamber is an otherworldly experience. It has its own microclimate, much cooler than the surface in the summer and warmer in the winter. Clouds of mist obscure the top of the pillars.
The dim interior, punctuated by spears of natural light from apertures in the ceiling, and towering pillars evoke an ancient religious structure, giving rise to names such as "the cathedral", "the shrine" or "the temple".
The drop of the No. 1 shaft is deep and wide enough to comfortably hold the Statue of Liberty.
The system kicked in four times in June, more than all of last year. During Typhoon Shanshan, it captured enough water to fill the Tokyo Dome baseball stadium almost four times, before pumping it safely into the Edogawa River and out to sea.
"Compared to years past, there's a tendency for a great deal of rain to come down all at once in what we call guerrilla downpours," said Yoshio Miyazaki, the land ministry official in charge of the complex.
"If this facility didn't exist, the water levels of the main Nakagawa River and its tributaries could rise much higher, leading to flooding of homes and even deaths," he said.
Even so, the system couldn't stop the inundation of more than 4,000 homes in the river basin from heavy typhoon rains in June 2023. Those floods prompted authorities to embark on a seven-year, 37.3 billion yen project to bolster levees and water drainage in the area.
And closer to the centre of Tokyo, another major project is underway to link channels that take in overflow from the Shirako and Kanda rivers. When completed in 2027, it will carry floodwater about 13 kms underground out to Tokyo Bay.
Tokyo's sewer network is designed to handle rainfall of up to 75 mm per hour, but increasingly there are localized storms bringing down as much as 100 mm, overtaxing the system, said Shun Otomo, a construction site manager for the project.
"For example, if there is a temporary downpour in the Kanda River basin, we can tap the watershed capacity in basin areas where it isn't raining," Otomo said. "We believe that will be effective against these guerrilla rains."