PHILADELPHIA — Odubel Herrera clapped his hands together and yelled toward the dugout as he ran to first base after yet another big hit.

The speedy center fielder is having fun again, and he’s helping his team win games, too.

Herrera kept up his hitting surge with a homer among his three hits and drove in three runs as the Philadelphia Phillies held off a late Chicago White Sox rally in a 7-6 win Tuesday night.

Tommy Joseph and Roman Quinn added two hits apiece and combined to drive in three runs for the Phillies. Herrera, who hits between Quinn and Joseph in the lineup, is 15 for 28 in his last seven games after slumping for most of the summer following his trip to the All-Star Game.

“I was a little disappointed because things were not working out the way I wanted them to work out,” Herrera said through a translator. “Thankfully now things are better for me and I’m putting the work in and the results are showing.”

Melky Cabrera hit a three-run home run for the White Sox, who have lost four straight. Struggling veteran James Shields (5-18), winless since July 26, allowed six earned runs and nine hits in 5 1/3 innings.

Trailing 7-3 in the ninth, the White Sox pulled within one on a two-out wild pitch and a two-run double from Adam Eaton. However, Michael Mariot came on and got Tim Anderson to ground out to short to end the game and pick up his first career save.

“It wasn’t pretty but we hung on to win that game,” Phillies manager Pete Mackanin said. “That was huge.”

Jake Thompson (3-5) gave up three runs and four hits over five innings. The rookie right-hander, who struggled for most of August after first getting called up from the minors, has won his last two starts and has a 2.99 ERA over his last five appearances.

For the second straight game, the Phillies jumped out to a 2-0 lead in the first inning. After Quinn walked, Herrera hit a 1-1 pitch into the Phillies bullpen for his 15th homer of the season.

Herrera also started a two-out rally in the third, singling and stealing second, before scampering home on Joseph’s two-out double. Joseph then came home when Anderson couldn’t handle a sharp liner off the bat of Maikel Franco, giving the Phillies a 4-3 lead.

Herrera’s big night continued in the fifth when he snuck a ground-ball through the hole between first and second to drive in Quinn and extend Philadelphia’s lead to 5-3. On the next pitch, the speedy center fielder stole his second base of the game and 24th of the season.

“He’s more disciplined at the plate,” Mackanin said of Herrera. “He looks more like the guy we saw early in the season than the guy we did for the last six weeks. For whatever reason, he seemed to lose focus but he seems to be getting it back. That bodes well for us.”

Quinn’s two-run single in the sixth provided enough insurance for the Phillies to open their second-to-last home series of the season with a win.

Before the ninth, Chicago’s big inning came in the third. With two outs and nobody on, Anderson doubled and Jose Abreu walked before Cabrera lined a 1-1 pitch just inside the right-field foul pole for his 12th home run of the year, putting the White Sox ahead 3-2.

“Offensively, we just kept chipping away and getting to a point, even in the last inning right there, you bring up the tying run,” White Sox manager Robin Ventura said. “We’ve got to be able to hold them, and that’s got to be the biggest thing.”

FLASHING LEATHER

With two on and one out in the fifth, sure-handed Phillies shortstop Freddy Galvis made a very nice sliding snag of Abreu’s grounder before starting an impressive inning-ending double play.

The Phillies also ended the seventh inning with a double play.

RED-HOT ROOKIE

Like Herrera, Joseph is also riding a hot streak with 10 hits in his last six games. The rookie first baseman has been playing more with veteran Ryan Howard hobbled with an injury.

MORE ABOUT HERRERA

Herrera became the first Phillies outfielder with three hits, three RBI and two stolen bases in a game since Ben Revere on March 31, 2014. He’s also the first Phillies outfielder with at least 15 home runs and 20 stolen bases since Shane Victorino in 2010.

TRAINER’S ROOM

Phillies: Ryan Howard missed his third straight game because of knee soreness. He had his knee drained over the weekend.

UP NEXT

The Phillies and White Sox close their two-game series Wednesday with Chicago LHP Chris Sale (16-8, 3.03) opposing Philadelphia RHP Jerad Eickhoff (10-14, 3.74).