Kiké Hernandez delivered Boston’s second straight walk-off win, scoring pinch-runner Danny Santana with a sacrifice fly in the ninth inning to send the Red Sox to the AL Championship Series with a 6-5 win over the Tampa Bay Rays on Monday night.

After winning Game 3 of their best-of-five AL Division Series on Sunday with Christian Vázquez’s two-run homer in the 13th, Boston took Game 4 for its first set of back-to-back walk-off postseason wins since 2004 ALCS Games 4 and 5, both courtesy of David Ortiz against the Yankees.

Rafael Devers had a three-run home run off rookie Shane McClanahan to ignite a five-run third inning that put Boston in front 5-0. Tampa Bay battled back and tied it in the eighth.

The wild-card Red Sox will await the winner of the other ALDS matchup between the Houston Astros and Chicago White Sox. Houston leads 2-1 going into Game 4 in Chicago on Tuesday, a makeup of Monday’s rainout.

Also read: MLB: Boston Red Sox bounce Tampa Bay in 13 after odd wall call

“Since day one, you guys believed in this group,” manager Alex Cora told his players before setting off a bubbly clubhouse celebration.

He said their belief is what got them to this point.

“We always said we had a good baseball team that had some holes, and we still have some holes, but at the end, for how bad it looked sometimes, we’re still here. We’re still in the dance,” Cora said.

Boston improved to 15-3 in potential clinching postseason games and have won each of their last eight. It brings an abrupt end to the season for the Rays, who’d been eyeing back-to-back trips to the World Series after winning 100 games during the regular season and rolling to the AL East title.

“There’s no doubt there’s disappointment,” Tampa Bay manager Kevin Cash said. “We had high aspirations to get deep into this thing. We ran into a Red Sox team that they just beat us — no other way around it. They got the big hits.”

The Red Sox are the second team to clinch a postseason series with consecutive walk-off wins. The other was the Minnesota Twins in the 1991 World Series, according to STATS.

Also read: MLB: Pederson’s 3-run HR powers Braves over Brewers for 2-1 NLDS lead

Vázquez led off the ninth with a single through the hole to left field and moved to second on a sacrifice bunt by Christian Arroyo. Travis Shaw then hit a bouncing ground ball to third that went for an infield single when Yandy Díaz bounced his difficult throw to first baseman Ji-Man Choi. Vázquez got to third and Santana entered to run for him.

“Old school baseball right there,” Cora said. “Fundamental baseball, and we won the ALDS playing good fundamental baseball.”

Hernandez, who was 9 for 20 in the series, scored Santana with a fly ball to left.

“All I gotta do is bring in the run from third,” Hernandez said. “And having Danny at third instead of Vazqy eased my mind a little bit.”

Rays postseason star Randy Arozarena ripped a tying single with no outs in the eighth inning of Ryan Brasier and advanced to second on the throw. Garrett Whitlock relieved and got through the eighth without further damage, then pitched a scoreless ninth for the victory.

“Once AC said you’ve got to keep going, that’s all I was focused on,” Whitlock said.

Red Sox starter Eduardo Rodriguez allowed two runs and three hits with six strikeouts over five innings, plus one batter. It was redemption after he lasted just 1 2/3 innings and gave up two runs in Boston’s 5-1 loss in Game 1.

Devers finished with three hits. Wander Franco had a two-run homer for the Rays.

With the game knotted at 5 in the eighth, Alex Verdugo grounded to shortstop Franco, who threw the ball wildly in the Red Sox dugout, allowing Verdugo to advance to second. With one out, Hunter Renfroe flew to center and Verdugo tried to tag, but he was thrown out at third by Kevin Kiermaier.

The Red Sox led 5-0 after three innings but Tampa pulled within 5-3 on Austin Meadows’ RBI single in the fifth and Franco’s two-run homer in the sixth off Tanner Houck.