ST. LOUIS — For much of Saturday night’s third game of the World Series, the St. Louis Cardinals seemed to be getting in their own way, letting two leads slip away and wasting repeated opportunities.

But in the end — a wildly controversial end — it was an obstruction call on Boston third baseman Will Middlebrooks for tripping a base runner that made the difference, allowing the Cardinals to celebrate an incredibly odd but extremely significant 5-4 victory.

“It’s a tough way to have a game end,” Boston manager John Farrell said. “Particularly of this significance.”

The final sequence was set up when the Cardinals had runners on second and third with one out in the ninth.

    Most Read Stories

John Jay hit a sharp ground ball that Sox second baseman Dustin Pedroia made a diving stop on and threw to the plate to get Yadier Molina out. Catcher Jarrod Saltalamacchia then threw to third to try to nab Allen Craig, but the ball got by a diving Middlebrooks.

As Craig, just activated after missing seven weeks with a sprained foot, got up to head to the plate, Middlebrooks, lying face down, kicked up both legs and Craig tripped. Third-base umpire Jim Joyce immediately called obstruction, and though the play continued with the Sox initially celebrating throwing out Craig at the plate, home plate umpire Dana DeMuth acknowledged Joyce’s call, determining that Craig otherwise would have scored. DeMuth immediately signaled safe, launching a bigger celebration from the Cardinals side.

“Not sure what happened,” Cardinals closer Trevor Rosenthal said. “I’m just glad we won.”

The obstruction was more a result of where Middlebrooks was than what he did, the umpires said, as the rule is designed to make sure the runner can proceed unimpeded, and that intent is not an issue.

“The feet didn’t play too much into it,” Joyce said.

Said Middlebrooks: “There wasn’t really anywhere for me to go. I was trying to get to the ball. As I was getting up, he was trying to get over me.”

Farrell was obviously frustrated.

“I don’t know how he gets out of the way when he’s lying on the ground and Craig trips over him,” he said. “Tough pill to swallow.”

The winning rally started when Molina slapped a one-out single to right. The Sox brought in closer Koji Uehara, who had been all but untouchable throughout the postseason, but Craig greeted him with a double.

Of the previous 55 Series tied 1-1, the team winning Game 3 has won the championship 37 times, including the past four times and 11 of 12.

The Cardinals took a 2-0 lead in the first, and the Sox rallied to tie with runs in the fifth and the sixth. The Cards went up 4-2 in the seventh, but the Red Sox came right back to even it up in the eighth.

In that inning, Boston took advantage of an odd play involving Cardinals rookie second baseman Kolten Wong. The Cardinals were already in trouble, as the Sox loaded the bases when Jacoby Ellsbury led off with a single, Shane Victorino was hit by another pitch and, with one out, David Ortiz was intentionally walked.

A double shift to bring in closer Rosenthal for a five-out save put Wong at second, and the ball quickly found him, hit sharply by Daniel Nava.

Wong made a tremendous one-hop stop but threw to second rather than first, and the relay for a double play was too late, allowing a run to score. Xander Bogaerts’ single made it 4-4.