Cody Asche belted a game-tying two-run homer in the eighth inning and scored the go-ahead run in the top of the 10th as the Phillies rallied from a three-run deficit to beat the San Francisco Giants, 5-3, at AT&T Park on Friday night.

The win snapped a three-game losing streak for the Phillies.

Asche led off the 10th with a double and scored the tie-breaking run when Chase Utley was hit (grazed is more like it) on the right knee by a pitch with the bases loaded. Ryan Howard followed with a sacrifice fly.

The attendance at one of baseball’s best and most exciting venues was 41,425. It was the Giants’ 308th consecutive sellout.