KANSAS CITY, Mo. — It all came undone in the bottom of the second inning, an ugly mess of a frame that will live forever in Bay Area sports infamy.

The Giants came into Game 6 of the World Series on Tuesday hoping to clinch their third title in five years. That hope vanished by the top of the third.

The Royals’ half of the fateful second started with the game in a scoreless tie. It ended with seven runs on the board, starting pitcher Jake Peavy long gone and the Giants facing a do-or-die showdown with the Royals on Wednesday.

That wasn’t just a crooked number on the board. The words twisted, gnarled and bent come to mind.

Peavy had come into the game with a little cloud over his head. Actually, the cloud surrounded his thumb. Peavy had tried to catch a foul ball in the dugout during Game 3, back in San Francisco, bending the digit backward and tearing some skin. Manager Bruce Bochy assured everyone that Peavy was fine, saying, “(Pitching coach) Dave Righetti, our trainer, they’ve looked at him. I’ve watched him throw, and you have to trust Jake. I’ve talked to him about this.”

And Peavy looked OK in the first, giving up a walk and a single but getting away unscathed.

The second inning was a different story. The Royals’ Alex Gordon broke out of a Series-long slump with a bloop single to center on an 82 mph changeup. The next man up, Salvador Perez, turned on a fastball and singled to right. Then Mike Moustakas doubled, driving in Gordon.

It looked like the wheels were coming off, but Bochy was staying with his man. Super long reliever Yusmeiro Petit was warming up in the bullpen, but Peavy soldiered on, striking out Omar Infante on a wicked cut fastball.

It even looked as if he might be able to get out of this thing, giving up maybe one or two runs. He just needed a little luck and some solid defense. He got neither.

The next batter, Alcides Escobar, hit a chopper to Brandon Belt at first base. The big fella fielded it cleanly but hesitated in getting the out because Perez had deked as though he was breaking for home off third base. In that moment of hesitation, Belt sowed the seeds of defeat.

By the time he recovered and started heading for first, the speedy Escobar had a step on him. Joe Panik stood at the bag, waiting for the toss, but Belt inexplicably tried to beat the Royals’ leadoff man to the bag … on foot.

News flash: Escobar is faster than Belt. Everyone was safe. It was still only 1-0, but the bases were loaded and Peavy stood on the mound, looking like a man who had forgotten to take his blood pressure medicine. For a month.

The inning unraveled from there. Going batter-by-batter might take all night. Suffice it to say that, with the bases loaded, light-hitting Norichika Aoki worked a seven-pitch count that ended with a single to left, scoring one.

That was it for Peavy, who left with a most unfortunate pitching line. Biggest game of his life: 11/3 innings pitched, six hits, five earned runs allowed, a career postseason ERA of 12.79, one heaping serving of goat stew.

“It was hard,” Peavy said afterward. The intense Southerner spent the rest of the game watching video with Game 7 starter Tim Hudson, trying to help him out.

“I thought (Peavy) had pretty good stuff tonight,” Bochy said. “I did. If he had a little luck, he probably gets out of that inning. ... The best thing about this game is we get to wash it off.”

Even Petit could not save the Giants in that infamous inning. Prior to Game 6, Inning 2, Petit had totaled 12 scoreless innings in three postseason appearances. He’d arrived on the national baseball map. But when he arrived at the mound Tuesday night in Kansas City, he saw Royals on every base.

Petit surrendered a single, then a double, then another double. The score was 7-0, and it seemed the bottom of the second would never end. It eventually did. Eleven Royals batted, one was stranded, three made outs. Game 7 was a foregone conclusion.

The rest of Game 6 was an extended party for Royals fans, who saw all their favorite players contribute. Billy Butler got a big hit. Moustakas hit a towering home run off Giants reliever Hunter Strickland, who seems to specialize in giving up very long flyballs.

None of that really mattered. The game was lost in the bottom of the second.

Bay Area sports history is filled with glorious moments, forever remembered by catchy names. The Ghost to the Post. The Holy Roller. The Catch.

Call this one the Second Inning Slaughter. It was a bloody mess, and it wasn’t even Halloween yet.