Mike Carp's liner to left was hit too hard to fall in for a single. It was hit too shallow to be a sacrifice fly.
First, Pedroia tagged up, and took a few steps toward home. But then he retreated back toward the base when he realized it wouldn't be deep enough.
When left fielder David Lough made an errant throw to the plate that spun all the way to the backstop and caromed around, Pedroia reversed directions again and came racing home to complete the comeback in a game the Red Sox trailed, 5-0.
"Obviously they were in close," said Pedroia. "I broke real quick in case it fell. He had a chance to throw me out at home. It was great positioning on their part. It worked out for us. It was kind of a crazy deal."
And a crazy night, one that started with an emotional ceremony in recognition of those who were impacted by last year's bombings at the Boston Marathon. This year's marathon is on Monday.
"Another emotional roller coaster here at Fenway, tear jerker there for a minute," said Jonny Gomes, who had the biggest hit of the comeback, nailing a three-run homer in the bottom of the sixth to make it a 5-3 game.
It was the first walk-off win of 2014 for the Red Sox. The first of 11 walk-off wins last season came on Marathon Monday.
After generating just two hits over the first five innings against Ubaldo Jimenez, the Boston bats came to life in the bottom of the sixth.
David Ortiz started it by drilling a single to right-center. Mike Napoli drew a walk. Up stepped Gomes, and his three-run shot soared over the Monster.
"Man, I was just going coattails on the celebration before the game," said Gomes. "But yeah, we finally got some runners on and I was able to get an offspeed pitch that he might have left up. It was a little bit of a kickstart for us."
The big momentum swing continued into the seventh. Brock Holt started that rally with a single up the middle. And then came a pivotal play, one the Red Sox probably caught a break on.
Grady Sizemore hit one back to the box, and Orioles reliever Zach Britton fired to second for the force. The only problem was that shortstop Ryan Flaherty dropped the ball on the transfer, and Holt was ruled safe.
There has been a lot of controversy in recent days about the way the transfer rule is being interpreted, and even the Red Sox acknowledged they were probably fortunate on this one.
"The much-talked about transfer play comes into our favor tonight," said Red Sox manager John Farrell.
Pedroia loaded the bases with a lined single to right. Ortiz smashed an RBI single to right to make it a one-run game.
"And it goes back to our approach at the plate," said Farrell. "Seeing a lot of pitches, driving up pitch counts, getting into a bullpen. Trying to get some favorable matchups on our part. But I think, over the last two games in [Chicago] through this series, it's been a much more consistent approach."
Then, the Orioles got sloppy again. Napoli hit a grounder to third and Jonathan Schoop's throw home was wide, and dropped by Matt Wieters. The error was charged to Schoop, and the game was tied at 5.
The Red Sox had some more fortune on their side in the top of the ninth. Farrell thought Delmon Young had been announced as a pinch-hitter, so he removed lefty Andrew Miller in favor of righty Edward Mujica.
As it turns out, Young never was announced, and the left-handed hitting Lough faced Mujica with a chance to drive in the go-ahead run from second. But Mujica struck out Lough and wound up getting the win.
"Yeah, was probably a little bit premature in the move," Farrell said. "As it turns out, we keep a .135 hitter in the game vs. a guy in Young who is somewhere in the .350 range. Eddie makes a couple of big pitches with his splitfinger, and gets a key strikeout."
Pedroia nearly ended the game with a blast to deep left against Orioles lefty reliever Brian Matusz earlier in the ninth. But it missed being a home run by inches, and wound up as a double off the top of the Green Monster. The umpires reviewed it and ruled that the play would stand as called, meaning the video was inconclusive.
Pedroia then moved to third on a wild pitch. Behind in the count, 2-0, Matusz intentionally walked Ortiz.
The Orioles then went to right-hander Darren O'Day to face Napoli. O'Day wound up hitting Napoli in the left kneecap. After initially staying on the ground in agony, Napoli got up and took his base.
Carp's liner ended it in unlikely fashion, thanks to Pedroia's ability to think on his feet and then use them.
"Talk about baseball IQ," said Gomes. "Having the knowledge to go back and tag. Ball gets by the catcher, kicks to the pitcher, he throws it, boom, double play, we're out of the inning. But he's obviously a step ahead of the game, knowing what's going to happen. He's a heck of a ballplayer, and he does all the right things."
Jake Peavy put the Red Sox in a 5-0 hole, but he battled his way through 5 2/3 innings. And eventually, his teammates did the rest.
"I thought it was a great win," Peavy said. "I thought the boys fought hard. I mean, it was crazy. But at the end of the day, any time the boys win, it's always a good day."