PITTSBURGH - Joe Panik hit a bases-loaded triple, Mac Williamson launched a 446-foot home run and the San Francisco Giants beat the Pittsburgh Pirates 5-3 Thursday for their 12th win in 14 games.

The Giants took three of four at PNC Park.

After hitting a key double late in Wednesday night's win, Panik put the Giants ahead 3-1 with his triple in the third inning. Williamson followed with an RBI single.

Williamson connected for his second home run of the season in the sixth.

Albert Suarez (3-1) gave up two earned runs in five innings. Santiago Casilla struck out three in the ninth for his 16th save.

Jonathon Niese (6-5) was tagged for five runs in six innings.

PHILLIES 7, TWINS 3

MINNEAPOLIS - Struggling Freddy Galvis homered and drove in a career-high five runs to help Philadelphia end a nine-game losing streak.

Cesar Hernandez tied a career-high with four hits and slumping Ryan Howard homered as part of his first multiple-hit game since April 29.

The Phillies won for just the second time in 15 games.

Jerad Eickhoff (5-9) gave up one earned run and five hits in six innings. In winning three of his past four starts, Eickhoff has allowed five earned runs in 24 2/3 innings. The last three Philadelphia wins over a 17-game span were all Eickhoff victories.

Looking to become the Twins first pitcher with four wins, Ricky Nolasco (3-5) allowed 10 hits and four earned runs in 6 2/3 innings.

TIGERS 5, MARINERS 4, 10 INNINGS

DETROIT - Pinch runner Cameron Maybin easily scored on a bases-loaded wild pitch by Steve Cishek with two outs in the 10th inning, giving Detroit a four-game sweep.

The Mariners, who missed a chance when Robinson Cano struck out with a runner on third to end the 10th, lost their sixth in a row.

Steven Moya drew a one-out walk from Cishek (2-4) and Maybin pinch ran. Pinch hitter Victor Martinez singled, with an error by left fielder Seth Smith on the play putting runners on second and third. After an intentional walk to load the bases, Andrew Romine struck out.

Cishek then threw a pitch that catcher Chris Iannetta couldn't corral, allowing Maybin to run home.

Kyle Ryan (3-2), who worked out of a bases-loaded jam Wednesday night, earned the win by escaping a jam of his own making in the 10th.

RED SOX 8, WHITE SOX 7, 10 INNINGS

BOSTON - Xander Bogaerts singled in the game-winning run in the 10th inning as Boston avoided a four-game sweep.

Chicago led 3-0, 4-1 and 7-5 before Boston sent it into extra innings with a run in the seventh and another in the eighth. The White Sox loaded the bases with nobody out in the 10th, but Craig Kimbrel (1-3) got J.B. Shuck on an infield popup and then struck out Tim Anderson and Adam Eaton.

In the bottom half, Matt Purke (0-1) walked two before Bogaerts lined one up the middle and Mookie Betts scored easily from second.

James Shields pitched his best outing since being acquired by the White Sox on June 4. Jose Abreu hit a three-run homer and Alex Avila had four hits for Chicago.

ATHLETICS 5, ANGELS 4

ANAHEIM, Calif. - Marcus Semien and Khris Davis homered to help Kendall Graveman get the first win by an Oakland starter in more than three weeks.

Graveman (3-6) gave up two runs and eight hits in 6 2/3 innings to get the first win for an A's starter since June 1 after the rotation had combined to go 0-9 in the previous 17 games.

Semien hit a three-run shot off Tim Lincecum (1-1) in Oakland's four-run second. Davis' solo shot in the fifth made it 5-2.

Sean Doolittle gave up a two-run homer to Jeff Bandy in the ninth but held on for his fourth save.

Home plate umpire Paul Emmel was hit in the head by Jefry Marte's bat with two outs in the ninth when the pinch-hitter lost control of it on a follow-through. Emmel fell to his knees before leaving the field with a towel held to his head.

MARLINS 4, CUBS 2

MIAMI - Giancarlo Stanton homered in the fourth inning and singled home the go-ahead run with two outs in the eighth, sending Chicago to its fourth consecutive defeat.

Christian Yelich started Miami's rally in the bottom of the eighth with a one-out walk against Pedro Strop (1-2). He advanced on a wild pitch and scored standing up on Stanton's opposite-field single. J.T. Realmuto followed with an RBI double.

Kyle Barraclough (4-2) pitched a scoreless eighth.

BRAVES 4, METS 3

ATLANTA - Adonis Garcia hit a go-ahead, two-run homer off Addison Reed in the eighth inning and Atlanta beat New York for the fourth straight time in a week.

The Braves trailed 3-2 when Freddie Freeman opened the eighth with a single off Jerry Blevins. Reed (1-2) relieved with one out and, with catcher Travis d'Arnaud calling for a chest-high fastball on an 0-2 count, Garcia connected on a pitch that badly missed the target for his fourth home run.

Jim Johnson (1-4) won in relief.

Arodys Vizcaino converted his 18th save in 21 chances.

DIAMONDBACKS 7, ROCKIES 6

DENVER - Nick Ahmed had a two-out RBI single in the ninth inning and Arizona recovered after blowing a late lead.

Diamondbacks closer Brad Ziegler (2-2) ending his streak of 43 consecutive successful save attempts dating back to May 29, 2015, a club record and the seventh longest ever. He allowed an inherited runner to score while the Rockies overcame a 6-3 deficit to tie it in the eighth inning.

Arizona regained the lead in the ninth off reliever Carlos Estevez (1-4).

PADRES 7, REDS 4

CINCINNATI - Derek Norris hit a three-run homer that completed San Diego's sixth-inning comeback, and the NL's highest-scoring team in June rallied to win a matchup of last-place teams.

J.C. Ramirez (1-3) gave up Norris' 10th homer run for a 6-4 lead.

Christian Friedrich (4-2) allowed four runs in five innings, including Adam Duvall's two-run homer. Fernando Rodney remained perfect in 16 save chances.