Posey, McCutchen lead Giants past Pirates 13-10

San Francisco Giants' Brandon Crawford slides into home plate to score the Giants' third run as Pittsburgh Pirates catcher Francisco Cervelli reaches in vain for him during the first inning of a baseball game Friday, Aug. 10, 2018, in San Francisco. (AP)

SAN FRANCISCO (AP) — The San Francisco Giants finally got their offense going, and they needed it to survive another shaky performance from their bullpen.

Buster Posey got four hits, Andrew McCutchen homered against his former team and the San Francisco Giants defeated the Pittsburgh Pirates 13-10 on Friday night.

“They just started swinging with I think more authority,” Giants manager Bruce Bochy said.

The Giants had lost three in a row and Pittsburgh had won three straight.

Posey broke out of a 0-for-13 stretch with his second four-hit game in less than two weeks. All four hits came in the first four innings as the Giants built a 10-2 lead.

He’s the first Giants player with four hits through the first four innings of a game since the team moved to San Francisco in 1958.

Posey and Alen Hanson each drove in three runs. McCutchen hit a leadoff homer and later drew four walks for a San Francisco team that batted .212 and averaged 2.7 runs over its previous six games.

“They were letting it go tonight,” Bochy said. “It was good to see them have some success, I mean we’ve been shut down, we’ve been due for a game like this where we break it open, even though they came back and made it a game. ”

Francisco Cervelli drove in five runs with three hits for the Pirates. His 11th home run of the season and fourth career grand slam, off reliever Pierce Johnson, closed Pittsburgh within 11-7 in the seventh inning.

Adeiny Hechavarria, playing his second game since being traded from Tampa Bay to Pittsburgh, went 2 for 2 with a home run.

Giants starter Derek Holland (6-8) gave up five runs in 6 1/3 innings.

A big night from the offense allowed him to be more aggressive.

“It’s huge,” Holland said. “The offense is putting in the work, and I’m little bit upset with myself. They put the runs up, I’ve got to keep the momentum on our side.”

Clay Holmes (1-2) was tagged for seven runs in 2 2/3 innings in his third career start.

“Our command was pretty inconsistent throughout the evening,” Pirates manager Clint Hurdle said. “Clayton was so good the last time out. His fastball command was off and that complicates things.”

HIGH HEAT

Giants third baseman Evan Longoria was hit in the back by a 97 mph fastball by Pirates reliever Kyle Crick in the bottom of the seventh. Longoria initially stayed in the game but was pulled in the top of the eighth. Longoria said he felt fine after the game, but wasn’t certain about his playing status for Saturday’s game.

“I don’t think he had intent,” Longoria said. “He threw a couple more to the backstop and almost hit (Joe Panik), he just obviously didn’t have a very good feel for where the ball was going tonight.”

OFF DAYS

Pirates OF Gregory Polanco struck out as a pinch-hitter. Manager Clint Hurdle said Polanco will get another rest day in Sunday’s series finale.

TRAINER’S ROOM

Giants: 1B Brandon Belt (hyperextended right knee) will start a rehab assignment with Triple-A Sacramento on Saturday, manager Bruce Bochy said. If all goes well, Belt could join the team for next week’s series against the Dodgers in Los Angeles, which starts Monday. … RHP Johnny Cueto, who underwent Tommy John surgery earlier this month, was moved to the 60-day DL. RHP Casey Kelly was selected to the Giants’ Major League roster in a corresponding move before Friday’s game. … RHP Derek Law was optioned to Triple-A Sacramento.

UP NEXT

RHP Trevor Williams (9-8, 3.88 ERA) will pitch Saturday for the Pirates. He has a 2.25 ERA without a decision in two career starts against the Giants. LHP Ty Blach (6-6, 4.28) will pitch for the Giants.