When finished, Salesforce Tower will be the tallest building in San Francisco. For now, it's a big hole in the ground. And at the bottom of that hole is a new, massive concrete slab—14 feet thick, spread nearly an acre in breadth, and ready to support 1,070 feet of glass, steel ... and a lot more concrete.

Pouring it all took more than 18 hours on a cloudy San Francisco Sunday. An armada of trucks delivered nearly 49 million pounds of concrete and brontosaurine pumps vomited it into the hole while a small army of rubber-booted workers scurried about, directing the flow. It was one of the biggest, longest concrete pours in history.

And it's all to keep the building upright. "Skyscrapers are basically big sticks coming out of the ground, so obviously one concern is the whole thing toppling over," says Leonard Joseph, structural engineer at Thornton Tomasetti, a firm in Los Angeles. High wind or quaking earth can make buildings bend and wriggle, and if the wriggling takes the upper mass too far off center, the bottom of the building will begin to lift. This is called hinging, and it is very, very, bad: Buildings that hinge tend to collapse.

Holding back the hinge means attaching the structure to something big, solid, and subterranean. In places like Manhattan, developers can drill down and affix buildings directly to the island’s shallow bedrock. But San Francisco's bedrock is below 300 feet of mud and clay, which is why the engineers for Salesforce Tower had to build a big, shallow, fake rock using concrete and metal.

That took 12,000 cubic yards of concrete—enough to fill nearly four Olympic swimming pools. That concrete began as (roughly) 7,900,000 pounds of cement, 9,000 cubic yards of sand and gravel, and 54,000 gallons of water at several mixing plants around the Bay Area. Over the course of 18 hours—beginning just before midnight on November 7—1,300 mixing trucks ferried the stuff to the site in downtown San Francisco. Then, two at a time, they dumped their contents into one of seven pumping trucks.

Those pumping trucks are awesome, by the way. Their booms reached from 150 to 190 feet long—enough to extend from the edge of the construction site to the center of the pit. "When they unfold they look like a praying mantis," says Michael Tymoff, senior project manager for Boston Properties, and guy in charge of building Salesforce Tower.

All that concrete did not slop down into an earthy void. In the weeks leading up to the pour, workers constructed a subterranean lattice of rebar—12 layers high, with six inches separating each layer. ”We used 5 million pounds of number 18 rebar, the largest size available," says Tymoff. At two and a quarter inches in diameter, grabbing a bar of No. 18 is like gripping the fat end of a baseball bat. It took eight iron workers to lift each 45-foot segment into place. That cagework will act as the foundation’s skeleton, but during the pour it also served as a catwalk for workers holding the cement hoses or the massive vibrators used to ensure the concrete had no air pockets.

The hardened slab, in all its mightiness, is but half of the tower's earthquake protection. It will keep the building from toppling sideways, but what about sliding back and forth? In a big earthquake, the ground is actually trying to slip sideways underneath the building. "You need something to keep you from changing addresses," says Joseph. Those somethings are called piles, in essence underground stilts connecting the building with the bedrock. In the lowlands of San Francisco’s Financial District, bedrock is 300 below street level. "We have 42 piles that go all the way down and are socketed 15 to 25 foot deep into the rock," says Tymoff.

Now that the foundations are complete, the only way to go is up. Next come the parking garages, then the lobby, then 61 floors of prime office space. "It will be the tallest building west of Chicago when it's complete," says Tymoff.

Wait a second, what about the Wilshire Grand down in Los Angeles? At 1,100 feet, its topping spire is about 30 feet taller than Salesforce Tower's crown. "Yes, but we have the highest occupiable floor," says Tymoff. "From a skyscraper geek perspective, I think they've got the nod. But then again that's because they have a fishing pole on top of their building." Whoever wins, the race to the sky starts deep in the ground.

UPDATE Correction: 12:05pm ET 11/12/2015 The original headline of this article stated "It Took 18 Hours to Pour San Francisco's Largest Ever Foundation." That distinction actually goes to the Transamerica Pyramid. That building's foundation took 16,000 cubic yards of concrete.