DETROIT — Marco Scutaro was with the Red Sox when they collapsed at the end of last season, and called that terrible September one of the worst times of his career. That Sox team, he believed, was capable of great things.

A year and two trades later, Scutaro sits atop the baseball world. His RBI single in the top of the 10th inning on Sunday night gave the San Francisco Giants a 4-3 victory over the Detroit Tigers and the World Series title.

“Our team has done some special things. It’s a joy,” general manager Brian Sabean said. “We could have been knocked out so many times.”

San Francisco won seven consecutive games to close the season, staving off elimination in the National League Championship Series against the Cardinals before sweeping the Tigers. They outscored St. Louis and Detroit 36-7 in those games.

“That’s what it makes so much special, the way we did it,” Scutaro said. “We’re always against the wall and my team, it just came through first series, second series, and now we sweep the Tigers.”

Scutaro hit .328 with eight RBIs and 11 runs scored in 16 postseason games. It was the end of a journey that saw the Sox trade him to the Rockies in January before he was then sent to the Giants in July.

He hit .362 for the Giants in the regular season and continued that in the playoffs, getting named the Most Valuable Player of the NLCS. Pablo Sandoval was the MVP of the Series but it was Scutaro who had the biggest hit.

“I knew he was a good player, but to get this many clutch hits? It was fitting that he got the game-winning hit,” Giants manager Bruce Bochy said. “Marco is the guy you want up there. You know he’s probably going to put the ball in play.”

Coke struck out the side in the ninth inning and to that point had fanned all seven batters he faced in the Series. But Theriot started the 10th inning with a single to right field. Brandon Crawford’s bunt pushed Theriot to second.

Coke struck out Angel Pagan before falling behind 3-and-1 against Scutaro. The fifth pitch was up and away but Scutaro poked it into center field. Theriot, running on contact, scored easily.

“Just wanted to give myself a chance,” said Scutaro, who had struck out only three times in 64 postseason at-bats. “I took a good swing.”

Three relievers combined on three scoreless innings for the Giants, striking out seven. Santiago Casilla was the winner.

The Tigers have lost seven consecutive World Series games dating back to 2006.

“There was no doubt about it. They swept us,” Tigers manager Jim Leyland said. “So there were certainly no bad breaks, no flukes.

The Tigers played without catcher Alex Avila, who suffered a bone bruise on his left arm on Saturday. They also lost second baseman Omar Infante in the ninth inning when he was hit by a Casilla pitch and broke a bone in his left hand.

Detroit’s best hitters — Miguel Cabrera and Prince Fielder — were 4 of 27 in the series. Cabrera’s wind-aided home run in the third inning gave the Tigers a 2-1 lead. It was their only lead of the series and it didn’t last long.

Scutaro was in the middle of it again, hitting a slow roller down the third base line and beating the throw from Cabrera in the sixth inning. After Sandoval struck out, Buster Posey homered to left field to give San Francisco a 3-2 lead.

Posey had been quiet in the Series until that swing, going 3 for 13 with one RBI.

The Tigers tied the game in the bottom of the inning. Giants starter Matt Cain retired Cabrera and Fielder before Delmon Young drove a slider into the seats in right field.

The shot gave Young three home runs and nine RBIs in 13 postseason games this season. He has eight home runs in two postseasons with Detroit, a franchise record.

Cain allowed three runs on five hits with two walks and five strikeouts. He threw 102 pitches, 67 for strikes.

Tigers starter Max Scherzer allowed three runs on seven hits. He walked one and struck out eight.

It was 44 degrees with 17-miles-per-hour winds swirling around Comerica Park at first pitch. The wind, which blew out to right field for most of the night, made it a difficult night for the pitchers and outfielders.

Football weather was hardly a problem for the Giants given all they overcame this season.

They lost All-Star outfielder Melky Cabrera to a 50-game suspension for the use of performance-enhancing drugs on Aug. 15. Ten days later, the division-rival Dodgers strengthened their roster by obtaining Josh Beckett and Adrian Gonzalez from the Red Sox.

But the Giants, counting the postseason, won 41 of their final 61 games.

“It’s amazing what they accomplished,” Bochy said. “I think when you look at this club, the terms ‘teamwork’ and ‘team play’ are used loosely. But these truly did. They set aside their own agenda and asked what’s best for the club.”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.