The Braves, however, fell two games behind first-place Philadelphia in the NL East. The Phillies beat Florida 2-1.
Atlanta held a one-game lead over San Francisco in the wild card race. The Giants had a late game against Los Angeles.
Hernandez (10-11) walked two, struck out six and hit a batter. Only one runner reached second.
The 35-year-old right-hander varied his pitches from a 61 mph curve in the second inning to Derrek Lee to nothing faster than an 85 mph fastball. He threw 118 pitches, 75 strikes.
“I just go out and do my job. I just try to beat somebody whether it’s against a playoff team or not. I felt good in the bullpen before the game and I had a good sinker, slider and curve ball,” said Hernandez.
“He had, honestly, perfect control all night long,” said Atlanta manager Bobby Cox.
“You really never know what’s coming at you. It could be anything from 60 mph to 85 mph,” said Lee.
Sean Burnett pitched a hitless ninth for the Nationals.
Adam Dunn hit his 35th home run, a mammoth 455-foot shot over the center field fence after Ryan Zimmerman singled in the second and Hernandez added a run-scoring double in the inning off Jair Jurrjens (7-6).
“Every game we lose right now is going to be frustrating, especially if the Phillies are winning. Every game we don’t win is going to be stressful,” said Jurrgens.
“It’s a tight race. It’s going to be tight. You’re not going to win every game,” said Lee.
Asked if he were prouder of his pitching or hitting, Hernandez replied: “Both. I was lucky today. I like to hit. The double was a pitch down the middle and then I got a slider and hit it out.”
Jurrgens allowed nine hits, four runs, walked one and struck out three in five innings.
The Nationals added a run in the seventh when right fielder Jason Heyward dropped a fly by Dunn for a two-base error. Roger Bernadina drove in the run with a sacrifice fly.
Washington got its final run on a solo home run by Ian Desmond, his 10th, in the ninth off Scott Proctor.
“There’s not a whole lot to play for this late. To spoil it for them feels good,” said Desmond.
Heyward reached base four straight times against Hernandez, drawing a pair of walks, a hit by pitch and a single.
NOTES: Dunn’s blast was the sixth longest in Turner Field history. The longest — 471 feet — was by Sammy Sosa on Sept. 1, 2001. … Jurrjens was 6-1 at Turner Field this season in nine starts prior to Tuesday night. … Hernandez had lost two in a row and four of his last five decisions. … It was the 11th time this season the Braves were shutout.