LOS ANGELES (AP)Mookie Betts broke an eighth-inning tie with a three-run homer and the Los Angeles Dodgers beat the San Francisco Giants 9-6 on Thursday night after blowing a five-run lead in the seventh.

Freddie Freeman homered early and the NL West leaders won their fifth in a row, eighth straight at home and 12th in 13 tries overall, with the All-Star Game logos on the field nearly obliterated two nights after the Dodgers hosted the Midsummer Classic for the first time since 1980.

”We got the win and that’s the most important thing,” Betts said. ”That’s why it’s a team game. You’ve got to pick each other up and we did that tonight.”

Betts also made a spectacular diving catch on Joc Pederson’s liner in the right-field corner for the final out.

”My initial read, I knew I was going to catch that one,” Betts said. ”I don’t get too excited about those. That’s my job, that’s what I’m supposed to do.”

San Francisco tied it on a grand slam by Darin Ruf in the seventh, then went ahead 6-5 in the eighth.

Trayce Thompson’s RBI triple off Dominic Leone (3-2) tied it 6-all with two outs in the bottom half.

”Thompson’s love triples,” tweeted Golden State Warriors 3-point ace Klay Thompson, older brother of Trayce.

Cody Bellinger drew a walk from left-hander Jarlin Garcia to set up Betts, whose 406-foot shot landed in the left-field pavilion, triggering a raucous reaction from what was left of the sellout crowd of 53,165.

”We grind through each at-bat. Nobody really gives away at-bats,” Betts said. ”That’s why we’re so good.”

Evan Phillips (4-3) worked one inning for the win, and Craig Kimbrel got three outs for his 16th save.

The Giants tied it at 5 with a five-run seventh when the Dodgers’ bullpen crumbled.

”I’m not going to make too much out of this one,” Los Angeles manager Dave Roberts said of the relief corps.

Phil Bickford gave up a solo homer to Evan Longoria. Facing a 2-2 count with two outs, Ruf launched his first career grand slam to left-center off Alex Vesia to even the score.

Phillips came on in the eighth and promptly walked Wilmer Flores before Pederson doubled to deep left. After Longoria grounded out, Luis Gonzalez was intentionally walked to load the bases. Phillips walked Thairo Estrada, forcing in Flores for a 6-5 lead.

Austin Slater grounded into a fielder’s choice to third and Max Muncy threw out Pederson at the plate for the second out. Pinch-hitter Joey Bart struck out to end the inning.

Freeman homered for his NL-leading 115th hit in the first.

Mitch White took a no-hit bid into the sixth as the Dodgers were cruising with a 5-0 lead.

White didn’t allow a baserunner until consecutive two-out walks to Austin Wynns and LaMonte Wade Jr. in the third. The right-hander got his only strikeout in the fifth, when Gonzalez went down swinging leading off.

Caleb Ferguson followed with two strikeouts in 1 1/3 scoreless innings.

Giants starter Carlos Rodon gave up five runs and six hits in five innings. The left-hander struck out seven and walked two.

TRAINER’S ROOM

Giants: INF Tommy La Stella (COVID-19 IL) will begin a rehab assignment with Triple-A Sacramento on Friday. He’s expected to get time at second base, designated hitter and third base. … LHP Jose Alvarez (left elbow) remains in San Francisco for rehab. … C Curt Casali (oblique strain) started hitting to go with the running he’s already doing. … RHP Mauricio Llovera (right flexor strain) was transferred to the 60-day IL. … RHP Zack Littell (left oblique strain) threw a bullpen in Arizona. … SS Brandon Crawford (right knee inflammation) began light baseball activity.

Dodgers: 3B Justin Turner left the game with abdominal tightness. … Roberts said he’s ”cautiously optimistic” that RHP Walker Buehler (right flexor tendon strain) will return in September. … RHP Dustin May (Tommy John surgery) will pitch three innings at Triple-A Oklahoma City. Roberts expects him back by mid-August. … LHP Andrew Heaney (left shoulder) will make a start in Arizona. … RHP Brusdar Graterol (right shoulder) is pain-free and should return soon. … OF Chris Taylor (left foot) is swinging a bat and throwing, but not able to run yet.

CATCH THIS

Bellinger and Trea Turner completed consecutive sliding catches in the fourth.

Bellinger went sliding on his rear in center field to rob Flores and keep White’s no-hit bid intact.

Turner wasn’t to be outdone one batter later. The shortstop gracefully slid on his knees in the dirt on the third base side to catch Pederson’s pop foul.

”He made a sweet play and sweet slide,” White said.

Roberts marveled, ”I don’t know anyone who can get such style points.”

DANCING BILLIE

Grammy-winning singer Billie Ellish and her producer-brother Finneas were on their feet dancing to one of her songs from their seats directly behind the Giants dugout between innings.

BELLI BOBBLEHEAD

Bellinger’s father, Clay, a three-time World Series champion with the Yankees, handled first pitch duties while holding his 7-month-old granddaughter in his left arm. Clay bounced the pitch in the dirt but his son deftly handled it on his bobblehead night while Caiden appeared nonplussed.

UP NEXT

Giants: RHP Logan Webb (9-3, 2.83 ERA) struck out five over six-plus innings against Milwaukee in his previous start before the All-Star break.

Dodgers: LHP Tyler Anderson (10-1, 2.96) makes his first start with the Dodgers against the rival Giants. He’s 1-3 with a 4.40 ERA in eight career starts against them.

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports