Jesus Flores' three-run, pinch-hit homer in the sixth inning brought a tedious game out of the doldrums and helped the Washington Nationals to a 5-0 victory over the Arizona Diamondbacks on Wednesday night.

The win ended last-place Washington's six-game losing streak, dropped first-place Arizona (45-46) back below .500 and denied the Diamondbacks their first three-game winning streak in nearly two months.

Nationals starter John Lannan, who receives the worst run support in the majors, threw six scoreless innings for his first victory since May 18.

Finally rewarded for a quality start, Lannan (5-9) allowed two hits and walked three. He had allowed three or fewer runs in seven of his previous eight outings without a victory to show for it. His win ended a streak of 12 quality starts by the Nationals without a win.

It was the Nationals' first shutout since May 19. Joel Hanrahan, Luis Ayala and Jon Rauch each pitched a scoreless inning in relief.

Diamondbacks starter Micah Owings (6-8), who missed his last start with an injured gluteus muscle, hit three batters and walked five over 5 2-3 innings, but the real damage was done when he was replaced by Connor Robertson in the sixth.

With the score 1-0 and runners on first and second, Robertson allowed a two-out RBI double to Kory Casto and Flores' three-run shot into the visitor's bullpen in left center.

The homer was Flores' fifth of the season and the first as a pinch-hitter in his career.

The game pitted the two worst hitting teams in the National League as well as two pitchers without a victory in their last combined 14 starts. On Tuesday, the teams played a 2-0 game in which neither run was earned.

The results, therefore, were mind-numbing.

Nine walks and nine hits. Three hit batters. Six double plays. For the first five innings, the game almost deserved to be rained out, but somehow the dark and stormy clouds that virtually surrounded Nationals Park managed to dump their rain elsewhere.

Owings was already among the league leaders in hit batsmen entering the game, and three more in two innings shot him to the top of the charts. He grazed Ronnie Belliard's jersey and then plunked Paul Lo Duca just above the left knee to load the bases in the second inning. He walked Casto, the No. 8 hitter, to force in the game's first run.

Owings nailed Austin Kearns in the upper arm in the fourth and nearly got Lo Duca again three batters later. Lo Duca shuffled backward, barely avoiding another bruise on his left leg.

That put Owings at 11 hit batters, tying him with Baltimore's Daniel Cabrera for the major league lead.

Notes:@ The Nationals are awaiting word on whether LHP Odalis Perez will be fined or suspended for his outburst against umpire Angel Hernandez. Perez called Hernandez "stupid and (an) idiot" after the umpire called two balks on him in Tuesday night's 2-0 loss to the Diamondbacks. Fans booed when Hernandez was introduced before Wednesday's game. ... The Nationals moved RHP Chad Cordero (shoulder) from the 15-day to the 60-day DL. ... Diamondbacks OF Justin Upton was scratched from the lineup with a strained rib cage muscle. ... Casto got his first career stolen base in the eighth.