SAN FRANCISCO (AP) — Conor Gillaspie hit a game-ending RBI double with one out in the ninth inning to lift San Francisco past the Philadelphia Phillies 8-7 on Sunday and give manager Bruce Bochy his 800th win with the Giants.

Ramiro Pena doubled down the right-field line off Severino Gonzalez (0-1) then scored standing up when Gillaspie lined a 1-1 pitch in the same direction. It was Gillaspie’s second career walkoff hit and the seventh by the Giants this season, most in the majors.

READ MORE: Department Of Fish And Wildlife's "Trap, Tag, Haze" Program Sabotaged By Angry Tahoe Community Members

Angel Pagan had a season-high four hits and two RBIs while five others had two hits apiece for San Francisco, which has won 13 of 15.

The teams combined for 28 hits, with the Phillies rallying to tie the score twice in the final three innings before Gillaspie’s game-winner.

READ MORE: 25,000 Pounds Of Lake Tahoe Trash To Be Turned Into Eagle Sculpture

Odubel Herrera homered and Peter Bourjos added three hits for Philadelphia.

Cory Gearrin (3-0) retired two batters for the win.

MORE NEWS: Golden State Warriors Beat Luka Dončić Led Mavericks, Reach Sixth NBA Finals In Eight Years

Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.