A game that started ahead of schedule with a sellout crowd for Paul Skenes and the bobblehead giveaway celebrating the National League Cy Young Award winner ended six-plus hours later with a whiff.

Cedric Mullins sent Yohan Ramirez’s 2-0 fastball 403 feet over the right-field wall for a two-run homer in the 13th inning to lift the Tampa Bay Rays to an 8-7 win over the Pittsburgh Pirates on Saturday at PNC Park.

Konnor Griffin slapped a two-out single to right field to score automatic runner Jake Mangum and cut the deficit to one run in the bottom of the 13th. That put runners on second and third for Joey Bart, who went down swinging to end the 4-hour, 12-minute game that included a 2:27 rain delay.

“We had a chance there,” Pirates manager Don Kelly said. “If we’re able to get one into the outfield grass, sneak one through, we win the game. And I think that that’s the part that, when we’re sitting there talking about these games, as tough as these losses are, we’ll learn something from it and continue to battle on. And the guys have shown that, throughout the first part of the season, that we have had a short memory.”

Fans waited in a line for the Skenes bobblehead that wrapped around the ballpark and spanned across the Roberto Clemente Bridge. With an impending rainstorm threatening to disrupt the sellout crowd of 37,773, the start time was moved up 35 minutes.

The Pirates took a 2-0 first inning lead when Bryan Reynolds drew a four-pitch walk with two outs, and Ryan O’Hearn belted a 1-1 cutter 379 feet to right field for his fourth home run.

Skenes got into a jam in the second, when Jake Fraley hit a leadoff single, Mullins reached on catcher’s interference by Henry Davis and Richie Palacios singled to load the bases. Hunter Feduccia followed by hitting a grounder to first base, where Spencer Horwitz chased Palacios before tossing it to Griffin for a forceout.

At first, it appeared Fraley had scored to cut the Pirates’ lead to 2-1. But it was ruled that no runners could advance on the play because Palacios had interfered with Horwitz and the Rays’ run was taken off the scoreboard.

Skenes recovered to strike out five of the next eight batters over two-plus innings. He got Taylor Walls looking at a called third strike on a full-count fastball at the bottom of the strike zone, a call the Rays challenged but was upheld after review. Skenes got Chandler Simpson to ground out to first to escape the second inning unscathed.

O’Hearn drew a full-count walk, and Marcell Ozuna followed by smashing a 0-1 sinker 387 feet to left field to increase the Pirates’ lead to 4-0. But a rainstorm interrupted play with two outs in the fourth inning, forcing fans and the teams to take cover and wait until play resumed.

“We’re not going to look to just play five and get out,” Kelly said. “Maybe with Paul, getting more innings would have been a big benefit of that. That was the thought in moving it up half an hour, trying to do that. But … I don’t think that this was a ‘we’re looking to go five and dive’ game.”

Skenes had five strikeouts without a walk in four scoreless innings before the game was halted with the Pirates protecting a four-run lead, only for the Rays to take over when play resumed following the delay.

“Short outing, but felt like the execution was pretty good,” Skenes said. “I wasn’t thinking about the weather. It was just frustrating that it took long, but we came back and had a couple good innings after that.”

Cam Sanders relieved Skenes, making his season debut a day after being recalled from Triple-A Indianapolis. Sanders walked Feduccia before striking out Walls and Simpson. The Rays rattled off five consecutive hits, starting when Junior Caminero doubled to left to drive in Feduccia and Jonathan Aranda singled to score Caminero to cut the Pirates’ four-run lead in half.

Lefty Evan Sisk replaced Sanders, only to give up a tying two-run double to pinch hitter Jonny DeLuca and the go-ahead single up the middle to Mullins as the Rays took a 5-4 lead. Davis threw out Mullins attempting to steal second base to end the five-run frame.

“When we came out of the rain delay, they jumped right on us, got five right away,” Kelly said. “For the bullpen to come in and shut it down the way that they did and hold it as long as they did there, I thought that they did a really good job.”

The Pirates tied it in the eighth, when Nick Yorke singled to right to drive in Brandon Lowe. In the bottom of the 10th, Lowe hit a fly out to left that allowed automatic runner Oneil Cruz to tag from second base to third. The Rays intentionally walked Reynolds and pinch hitter Mangum, loading the bases with one out. But Rays reliever Kevin Kelly used his sinker to get Ozuna to go down looking at a called third strike despite an ABS challenge, and Yorke swinging to end the inning.

In the 11th, Ben Williamson advanced to third on a Nick Fortes groundout and tried to score on a Walls bunt, but reliever Yohan Ramirez fielded the ball with his glove and underhanded it to Davis, who blocked Williamson’s path to the plate to prevent the run.

Ramirez, however, attempted to pick off Walls at first base — only for his throw to skip past Horwitz and kick down the right-field line. The throwing error allowed Walls to score the go-ahead run and give the Rays a 6-5 lead.

The Pirates tied it in the bottom of the 11th when automatic runner Yorke advanced to third on a Horwitz groundout, then slid head-first to beat the throw from Williamson on Griffin’s grounder to second base. They went 2 for 17 with runners in scoring position and left 12 on base

“We had chances. We had opportunities to win the game,” Kelly said. “Just couldn’t come up with that big hit.”