Yu Darvish pitched 5⅓ innings in a no-decision Thursday afternoon and the San Diego Padres snapped a five-game losing skid by defeating the San Francisco Giants 7-6 on a walk-off single.

Darvish gave up four runs and three hits, including a two-run homer to Mike Yastrzemski in the second inning, while striking out seven and walking three in front of 31,049 fans at Petco Park.

Victor Caratini's infield single in the 10th inning off Dominic Leone (3-5) allowed San Diego to avoid being swept by the Giants in the Padres' final homestand of the season.