At Petco Park on Tuesday night, the San Diego Padres staged a dramatic late-inning rally to overcome the Washington Nationals 5-4, keeping their postseason ambitions firmly on track. The victory trimmed the Padres' deficit to a half-game behind the Arizona Diamondbacks for the National League's final wild-card berth, as Arizona edged Kansas City 5-3 in 11 innings.

San Diego found itself in a deep hole early. Nationals starter Riley Cornelio, recently called up from Triple-A Rochester, was virtually unhittable through three innings, striking out four and setting down all nine batters he faced. The Padres' own starter, Case Mize, battled through 5 2/3 innings, allowing three runs on four hits while fanning seven. However, a two-run double by Brady House in the fourth and a solo homer from Yohandy Morales in the fifth gave Washington a 3-0 lead.

The Padres finally broke through in the seventh. A sacrifice fly from pinch-hitter Austin Hays scored their first run, cutting the deficit to 3-1. But the Nationals answered immediately in the top of the eighth when pinch-hitter Andrés Chaparro crushed a solo home run, extending the lead to 4-1.

Then came the decisive frame. Washington reliever Jared Simpson lost the strike zone entirely, walking the first three Padres batters he faced. Manager Dave Martinez summoned Erik Tolman (0-1) from the bullpen. Hays, again pinch-hitting, lifted a sacrifice fly to left, scoring one run but leaving runners at first and third. On the next pitch, a passed ball allowed Fernando Tatis Jr. to advance to second. That brought up Manny Machado, who fought through an eight-pitch at-bat before lining a single to center field, driving in both runners and knotting the game at 4-4.

Machado then moved to second on a single by Ty France. With two outs, Luis Campusano stepped to the plate and blooped a broken-bat single to center, allowing Machado to race home with what proved to be the winning run.

David Morgan (3-1) entered the game to face a single batter in the top of the eighth, stranding a Nationals runner at third to earn the win. Adrian Morejon polished off a perfect ninth inning for his third save, sealing San Diego's fourth victory in five games.

On the offensive side, Machado collected two singles, passing Garry Templeton to claim sole possession of second place in Padres history with 1,137 hits. The franchise record belongs to Tony Gwynn, who sits at 3,141. For Washington, the loss extended their skid to six games and dropped them to 67-80, now last in the NL East behind the New York Mets.

The two teams meet again Wednesday afternoon, with Nationals left-hander Jackson Kent (1-3, 5.55 ERA) opposing Padres right-hander Walker Buehler (8-6, 4.56).