Bryce Harper made a barehanded catch in centerfield and led off the ninth inning with a double, setting the stage for a walk-off home run.
The Nationals defeated the Diamondbacks 5-4 thanks to a two-run home run by Ian Desmond with two outs.
"He was born for these situations," Washington manager Davey Johnson said of Harper.
Harper had his first multi-hit game in the Major Leagues with a single to go along with his double in the ninth.
The win ended Washington's five-game losing streak.
Harper Helps Washington End Skid