SAN FRANCISCO (AP) — Reigning NL Cy Young Award winner Blake Snell was removed after a 42-pitch first inning, and San Francisco rallied to beat the Arizona Diamondbacks 3-2 Thursday behind an walk-off double in the ninth from Patrick Bailey, who drove in all three Giants runs.

Arizona sent eight batters to the plate in the first inning, taking advantage of defensive sloppiness. Shortstop Tyler Fitzgerald threw wide of second for a run-scoring error on Josh Bell’s grounder and Corbin Carroll scored from third on a passed ball as Jake McCarthy reached on the dropped third strike.

Snell allowed two hits and walked two, stranding a pair of runners when Kevin Newman grounded out. He entered with a 1.30 ERA over his last 10 games. Only one of the runs off him were earned.

Bailey tied the score 2-2 with a two-run, two-out single in the fourth off Merrill Kelly.

Tyler Fitzgerald singled off Kevin Ginkel (7-3) leading off the ninth and stole second as catcher Adrian Del Castillo’s throw was wide. Bailey followed with a ground-rule double to left-center, lifting the Giants to just their second win in eight games.

Bailey entered hitting .080 (6 for 75) from July 31 on.

Landen Roupp (four innings), Erik Miller and Tyler Rogers (one inning each), Camilo Doval (two outs) and Ryan Walker (four outs) for two-hit relief. Walker improved to (-3

Kelly struck out eight in seven innings.

TRAINER’S ROOM

Diamondbacks: INF Ketel Marte (sprained left ankle) could be activated off the injured list during the team’s next series at Houston.

UP NEXT

Diamondbacks: RHP Brandon Pfaadt (9-7, 4.32) starts Friday at Houston, which opens the series with LHP Framber Valdez.

Giants: San Diego RHP Michael King (11-8, 3.17 ERA) starts Friday’s series opener against the visiting Giants.

___

AP MLB: https://apnews.com/hub/mlb