Stephen Strasburg made his first major 3, in the second test of a four-game series.
Strasburg allowed just two hits and didn't walk a batter while striking out four. His fastball topped out at 99 mph and his changeup averaged in the low 90s.
He was on a limited pitch count on a rainy night and threw 40 of his 56 pitches for strikes.
"He was special," Nationals manager Davey Johnson said. "He stayed down most of the time. He went up when he wanted to. It was fun watching him. It was like he never went out."
Strasburg had not pitched in the majors since August 21, 2010, because of a torn ulnar collateral ligament in his right elbow, an injury that resulted in Tommy John surgery.
Rod Barajas' two-run double in the eighth inning off of Henry Rodriguez (3-3) put the Dodgers ahead for good as they handed the Nationals their 11th loss in 14 games.
Andre Ethier added two hits and four RBI as Los Angeles improved to 12-3 over its last 15.
Kenley Jansen (2-1) struck out the side in the seventh to earn the win. Ted Lilly started the game for the Dodgers and allowed three runs -- two earned -- on four hits and three walks while striking out nine over five innings.
Washington loaded the bases with one out in the ninth inning against Javy Guerra on singles by Rick Ankiel and Ryan Zimmerman, and a walk to Ian Desmond, bringing the tying run to plate. But Guerra struck out Michael Morse on an outside fastball and got pinch-hitter Corey Brown on a fly out to left to end the game.
Dee Gordon hit the fourth pitch Strasburg threw into left-center field for a leadoff double. After James Loney flied out to center field, Gordon advanced to third on a Matt Kemp groundout, but Strasburg induced a fly out to right by Juan Rivera to strand him there.
Strasburg did not allow another base runner until Rivera's single with two outs in the fourth.
"He lives up to the hype of what he has. He has great stuff," Ethier said. "He commands all his pitches, hits his spots."
After leaving the bases loaded in the first, the Nationals broke through in the second on back-to-back doubles by Chris Marrero and Wilson Ramos. Strasburg followed with a sacrifice bunt to the left side of the infield, but Lilly's short-hop throw bounced past Loney at first and Ramos scored on the throwing error.
Desmond's base hit to right put runners on the corners, and Jayson Werth's groundout to short brought Strasburg across the plate for a 3-0 lead.
Doug Slaten started the sixth inning for Washington and allowed consecutive singles to pinch-hitter Jamey Carroll and Gordon to start the frame. After Loney struck out, Brad Peacock took over for his major league debut.
Kemp then hit a hard grounder to short that Desmond deflected into left field, allowing Carroll to score. A Rivera walk loaded the bases with one out, and Ethier lined a ball back up the middle to plate Gordon and Kemp. Aaron Miles' single loaded the bases again, but Barajas grounded into a 6-4-3 double play to end the inning and keep it a 3-3 game.
Ethier reached first on a fielder's choice in the eighth and Miles followed with a base hit to left before Barajas lined a double into the left-field corner, scoring Ethier and Miles and giving the Dodgers a 5-3 lead.
The Nationals stranded a runner on third in the eighth, and Ethier slapped a two-run double into right-center off of Yunesky Maya in ninth to put the game away.
Before the game, Washington reinstated Strasburg from the 60-day disabled list; recalled pitchers Maya, Craig Stammen and Atahualpa Severino as well as Brown from Triple-A Syracuse; selected Peacock and infielder Steve Lombardozzi from Syracuse; transferred pitcher Cole Kimball to the 60-day disabled list; unconditionally released pitcher Adam Carr; and designated pitcher Garrett Mock for assignment...Los Angeles recalled pitcher John Ely, catcher Tim Federowicz and outfielder/infielder Jerry Sands from Triple-A Albuquerque...Marrero's double in the second inning was the first extra-base hit of his career...It was just the second time in Lilly's last seven starts that he gave up at least three runs...Los Angeles improved to 4-7 all-time at Nationals Park...The game was delayed by 31 minutes in the seventh inning because of rain.