There was no postgame fireworks show scheduled for the Fourth of July at Target Field. It was, after all, a day game under a bright blue sky and puffy clouds. So instead, Harrison Bader provided some fireworks of his own.

Bader hit a home run in the fifth inning to get the Twins on the board and smacked the first walk-off home run of his career in the ninth inning to send the Twins to a 4-3 win over the Tampa Bay Rays on Friday in the first game of the series.

“You just genuinely have to believe you’re always one pitch away or one swing away or one driving play away from making the tides turn,” Bader said. “I hear my teammates in my head saying ‘One pitch away, one swing away.’ When you have a lot of guys reinforcing that and guys who care and want to win just like you, good things happen. You truly do become one swing, one pitch away.”

Because of the efforts of many — Bader himself, starter Chris Paddack, Louie Varland, who threw two scoreless innings, and others — the Twins (42-46) really were one swing away when Bader stepped up to the plate in the ninth inning.

Knotted at three, the outfielder unleashed on the first pitch he saw, a 91.8 mile per hour sinker, from Kevin Kelly, sending it out to left field and the Twins to a much-needed win.

“It felt good just to deliver for my team, man,” Bader said.

Bader’s first home run, another first-pitch blast, opened up the scoring in the fifth inning, giving the Twins a lead they held just briefly.

Paddack, who looked strong in his outing, started his day by retiring the first 11 batters he faced but he ran into some trouble in the sixth inning, eventually leading to the end of his day. The Rays (48-40) scored two runs in the sixth, chasing Paddack from the game and another in the seventh off reliever Brock Stewart.

But that was all they would get, as Cole Sands entered bailed Stewart out of a jam, stranding a pair of runners in the seventh and then Varland threw perfect eighth and ninth innings.

“I’m sure the whole team was willing to do anything to win the game,” Varland said. “That was just my part.”

Varland’s performance came after the Twins clawed their way back to tie the game. After not scoring more than two runs in each of their past four games, it seemed as if the Twins might be on track for more of the same on Friday, unable to convert on some of their earlier opportunities.

In the seventh inning, they used a Byron Buxton single to left to grab a run and a Brooks Lee hit by pitch to force in another, tying the game. The Twins couldn’t push another run across with shortstop Carlos Correa striking out to end the inning. But from there, Varland and then Bader took over.

“We needed that as a team,” Paddack said. “Comeback win, a walk-off home run by Bader, at home, Fourth of July, just the energy change in that clubhouse over the last week versus today was night and day different.”