Koji Uehara wasn’t Boston’s first choice to be closer this season.

Or the second.

The 38-year-old right-hander got the job after neither Joel Hanrahan nor Andrew Bailey lasted as closer. Uehara was setting up for them before he inherited the ninth-inning role in late June, and by October he was the AL championship series MVP.

“All I can say that I’m extremely, extremely happy right now,” he said after the Red Sox beat the Detroit Tigers 5-2 in Game 6 of the ALCS on Saturday night to advance to the World Series.

Uehara pitched a scoreless ninth in the clincher, giving him three saves and a victory in the four wins Boston needed to win the AL pennant for the third time in 10 years. After converting 21 of 24 save opportunities in the regular season with a 1.09 ERA, he is five of five while allowing one run in nine innings in the playoffs.

And he’s not done yet.

The World Series starts in Boston on Wednesday, when the Red Sox will play the St. Louis Cardinals in a rematch of the 1946, 1967 and 2004 Series. Uehara is a big reason why, anchoring a bullpen that allowed the Tigers just one run in 21 innings of relief.

“I think coming to the postseason, there were a lot of questions circling around our guys to bridge it to Koji,” said Red Sox manager John Farrell, praising setup men Junichi Tazawa and Craig Breslow, who along with Brandon Workman pitched four scoreless innings after the Red Sox fell behind 2-1. “They couldn’t have pitched anymore consistently, more effectively.”

Since giving up a game-ending homer to Tampa Bay’s Jose Lobaton in Game 3 of the division series, Uehara has allowed zero runs, four hits and no walks in 7 1-3 innings. He pitched a perfect ninth in the Game 2 victory over the Tigers, got four outs for the save in the third game, retired five in a row in Game 5 and closed out the series with another scoreless inning.

That’s why he was leaping into catcher Jarrod Saltalamacchia’s arms after striking out Jose Iglesias to clinch the trip to the Series and draped in an AL championship flag on the stand wheeled onto the infield for the trophy presentation.

“I was reading a lot of the articles today about when they signed him, they probably in their own mind didn’t anticipate this was going to happen,” Tigers manager Jim Leyland said before the finale. “But sometimes it does. And they caught lightning in a bottle. He’s been absolutely terrific, there’s no question about that. And obviously his significance right now is probably as important as anybody they’ve got on their team.”

Uehara had a 1.75 ERA in 37 relief appearances for the Rangers last year, holding batters to a .160 average. The Red Sox signed him at the winter meetings to a deal that guaranteed him $4.25 million. He he’s earned another $800,000 bonuses and finished enough games to guarantee a 2014 salary of $5 million.

“It was more of how the team wanted me, their passion to acquire me and the sincerity,” Uehara said after collecting his ALCS MVP trophy. “I felt honored to play for this team.”

But no one expected him to be the closer.

Three weeks after signing Uehara, the Red Sox acquired Hanrahan. But he only lasted until the first week in May before needing season-ending elbow surgery. Bailey, who missed most of last season following thumb surgery, gave closing a shot but was ineffective before giving way to Uehara and then shutting it down around the All-Star break.

Although Farrell conceded Uehara was promoted out of necessity, it’s not like the team didn’t see the potential from the start.

“We knew he was going to be a key contributor toward the back end of the bullpen,” Farrell said last week. “His track record indicates that. … And I keep going back to the fact that he’s not doing something this year that is so out of the norm for him. He’s been a very successful pitcher, whether it’s been in Japan or here. But the fact he’s the closer here, he’s gained the notoriety that he deserves.”