Backup catcher Craig Tatum had two hits and two RBIs for the Orioles, who improved to 6-17 on the road by winning the opener of this three-game interleague series dubbed "The Battle of the Beltway," which should be avoided this weekend because of some emergency work.
Hernandez (1-5) had lost 11 straight decisions since beating Oakland on Aug. 11, 2009 -- the second-longest dry spell in Orioles history behind Mike Boddicker's 13-game skid (1987-88).
"It feels a lot better than getting a loss, that's for sure," he said. "It's always great when the team gets a victory and I can pitch well enough to get a victory."
In his first seven starts, the Orioles scored a total of seven runs while Hernandez was in the game. In this one, they went up 2-0 in the second inning on Jones' first homer since April 24, then made it 4-0 in the third.
"It definitely helped getting a two-spot in the second inning and then adding another two runs," Hernandez said. "I was able to relax."
Hernandez had a no-hitter until Nationals pitcher Miguel Batista singled with two outs in the fifth.
"My hits are like comets," Batista said. "They happen every five or four years."
It was Batista's first hit since Aug. 9, 2006, when he doubled against San Francisco for Arizona. Since then, he had gone 0 for 22.
Hernandez walked five, including two straight with one out in the sixth that led to his departure after 105 pitches.
"He gave us what he had," Orioles manager Dave Trembley said. "Maybe this will get him on a roll."
Willie Harris homered for the Nationals, who have lost seven of eight to fall under .500 for the first time since April 15.
"I don't think we're in a rut. We're just not scoring big runs when we need to," Harris said. "... We're on a little skid, but I don't think it's anything serious, anything to worry about."
After Hernandez was pulled, Matt Albers walked Josh Willingham before giving up a run-scoring groundout to Ivan Rodriguez. Albers then yielded a two-run homer to Harris in the seventh.
The Orioles made it 5-3 in the eighth when Tatum walked and scored on a two-out single by Corey Patterson.
Alfredo Simon, the fifth Baltimore pitcher, worked the ninth to complete the five-hitter and earn his sixth save.
Nationals starter Scott Olsen (2-2) allowed four runs and six hits in three innings before leaving with left shoulder tightness. He gave up as many runs in this game as he did in last five starts combined.
"He was not feeling good from the bullpen on, and just tightness in his shoulder," Washington manager Jim Riggleman said. "He was trying to battle through and he gave us everything he had. A very gutty performance."
The Orioles went up 2-0 in the second inning when Luke Scott hit a leadoff single and Jones followed with his fourth home run.
"That felt good. It's been a struggle," Jones said. "But the name of the game is keep swinging the bat, so I kept swinging it."
Jones left in the fourth inning with a leg cramp, but he said it soon went away.
In the top of the third, a single and two walks loaded the bases for Tatum, who hit a two-run single up the middle. Tatum was subbing for injured Matt Wieters, who sat out with a sore right knee.