The Bronx Bombers finally are bombing.

The Yankees won a second straight series for the first time this season, hitting three home runs and defeating the Royals, 7-3, Thursday night in front of 35,944 at the Stadium. In taking three of four from the pitching-poor Royals, the Yankees totaled nine home runs.

“We went through some tough times, there’s no doubt about that,” Joe Girardi said. “But we’ve seen them pull out of it. We have a tough series coming up and we need to stay at it.”

The Yankees (14-19) improved to 5-2 on a 10-game home stand, with the AL Central-leading White Sox arriving Friday night.

Starlin Castro started things with a solo homer in the first and Chase Headley, who had been without an extra-base hit this season, hit a two-run homer in the second.

“It’s been a long time,” said Headley, who came in with a .178/.265/.178 slash line in 28 games. “I’ve still got a long ways to go. It’s not an easy place to play when you’re not playing well.”

Didi Gregorius added a two-run shot in the fourth as the Yankees continued their offensive surge with Alex Rodriguez and Jacoby Ellsbury unavailable because of injury.

“That’s what makes a good team a good team, you need contributions from everyone in the lineup” said Carlos Beltran, who walked twice and scored a run. “Right now it seems like Didi’s swinging the bat better, Chase has looked really good at the plate, [Brian] McCann, myself, Starlin . . . We’re going to be able to put runs on the board, that’s my feeling.”

Nathan Eovaldi was merely OK in improving to 3-2, and in many ways was fortunate. He allowed three runs and eight hits in five innings, departing with a 5-3 lead. He was lucky Salvador Perez’s long fly to end the fifth inning, with two runners on, was caught by Beltran at the base of the wall in right. Another few feet and Eovaldi, who did not have a very good splitter, would have been staring at a 6-5 deficit.

“I have to do a better job of getting the pitches down,” said Eovaldi, who allowed one home run and was saved by a couple of fine defensive plays, including one by a diving Mark Teixeira in the first inning.

Ian Kennedy, drafted 21st overall by the Yankees in 2006 and dealt to the Diamondbacks in December 2009, came in 4-2 with a 2.13 ERA but didn’t keep the ball down much, either. He allowed seven runs and five hits, including the three homers, in 6 1⁄3 innings. Former Yankee Chien-Ming Wang allowed an inherited runner to score in the seventh on a bases-loaded walk.

That run pushed the lead to four and took Aroldis Chapman out of the mix. Up until then it appeared as if, for the first time, Girardi would be able to deploy his three-pronged bullpen monster, with Dellin Betances giving way to Andrew Miller giving way to Chapman.

Betances pitched a scoreless seventh and Miller threw a scoreless eighth. Chasen Shreve came on in the ninth.

In the seventh, Eovaldi retired Alcides Escobar and Lorenzo Cain before Eric Hosmer doubled. A walk to Kendrys Morales brought up Alex Gordon, who homered earlier. He scorched an RBI single to center, making it 5-3.

Next came Perez, who took a 1-and-2 splitter to the opposite field and nearly put it in the seats. But the ball died in Beltran’s glove in right, allowing the crowd, and Eovaldi, to exhale.

“The offense,” Eovaldi said, “has been great.”