OAKLAND (AP) — Khris Davis blooped a two-run single in the 10th inning that glanced off second baseman Starlin Castro’s glove in shallow center and the Oakland Athletics beat the New York Yankees in a seesaw 8-7 win Thursday night.

It was Davis’ third career game-ending hit and came afteCastro had put the Yankees ahead in the top half on a sacrifice fly.

Davis’ game-winner came off Giovanny Gallegos (0-1) to finally close out the 4-hour, 29-minute game. Rajai Davis singled with two outs and Chad Pinder’s double put runners on second and third.

Liam Hendriks (3-1) pitched the top of the 10th for the win on a night New York stranded 13 baserunners and Oakland 12.

The A’s had failed to hold their leads all game, then came through to snap a three-game skid with just their second victory in the last eight.

© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed