Harper became the youngest major leaguer to homer since 1998, going deep on a solo shot to straightaway center field in the third inning off right-hander Tim Stauffer. The home run came in the outfielder's 15th game and 54th at-bat with the Nationals.
Chase Headley was one of three Padres to score in the fourth when he bowled into Leon on a play at the plate, causing the catcher's right ankle to buckle under him. Headly briefly gave the Padres a 5-4 lead an inning later with an RBI single. He also doubled and made two errors.
Chad Tracy and Xavier Nady each connected in the eighth inning for Washington.
Craig Stammen (3-0) pitched two innings for the win. Washington closer Henry Rodriguez walked the bases loaded with one out in the ninth inning before giving way to Sean Burnett, who got Jesus Guzman to ground into a 1-2-3 double play for his first save.
Miles Mikolas (0-1) gave up two runs and two hits while getting just one out.
Stauffer was reinstated from the disabled list before the game and started for the first time this season after being sidelined with a strained right elbow. He gave up four runs — three earned — on seven hits in five innings. He struck out five and walked three.
Nationals starter Ross Detwiler gave up a season-high four earned runs — five overall — on seven hits in five innings. In his seventh start of the season, his ERA rose from 2.10 to 2.75.
In the third inning, Ryan Zimmerman had a run-scoring single and Roger Bernadina scored from third when Headley missed a pick-off throw from catcher Nick Hundley. Then the 19-year-old Harper drove a 2-1 pitch to the grass backdrop just to the left of the 402-foot marker with two outs.
Harper raced around the bases quickly and continued his sprint straight to the dugout, where he exchanged high-fives with teammates. As the crowd cheered, Harper came to the top of the dugout steps for a curtain call, thrusting his right index finger into the air.
He's the youngest player in the majors — and, at 19 years, 211 days old, the youngest to hit a homer since Adrian Beltre of the Los Angeles Dodgers connected when he was 19 years, 171 days old on Sept. 25, 1998, according to STATS LLC.
Harper's homer gave the Nationals a 4-1 lead, but San Diego tied the game with a three-run inning in the fourth. With two on and one out, Orlando Hudson hit a single to center field that scored two runs, the second coming on Headley's collision with Leon. Hudson later scored on Stauffer's sacrifice.
After Headley gave the Padres the lead an inning later, Ian Desmond put Washington ahead for good in the sixth with a two-run double off the right field wall. Tracy and Nady added a pair of insurance runs with their eighth-inning solo homers.
NOTES: Leon was called up from Double-A Harrisburg on Sunday to replace catcher Wilson Ramos, who tore the anterior cruciate ligament in his right knee a day earlier at Cincinnati. He started Monday's game and struck out in his only at-bat. ... Washington manager Davey Johnson said before the game Rodriguez would remain the team's closer, despite Rodriguez blowing his third save in 11 chances Sunday against the Reds when he gave up Joey Votto's game-ending grand slam. ... In a rehab start at Triple-A Syracuse on Monday, RHP Chien-Ming Wang threw eight-plus innings, allowing four earned runs and 11 hits with one walk, one strikeout and one hit batter. ... Johnson said OF Michael Morse is on pace to return when interleague play begins June 8 at Boston. ... The Padres optioned LHP Josh Spence to Triple-A Tucson before the game. ... San Diego OF Jeremy Hermida is scheduled to undergo sports hernia surgery on Tuesday and will be out up to six weeks, manager Bud Black said. Hermida has been on the DL since late April.