WASHINGTON -- Jason Hammel pitched into the seventh inning and Justin Ruggiano had three hits and two RBIs as the Chicago Cubs banged out 14 hits and beat the Washington Nationals 7-2 on Friday.

Hammel (8-5) is 8-0 in his career in 10 starts against the Nationals (46-39), who saw their five-game winning streak end. Hammel gave up two runs and five hits in six innings before Virginia native Neil Ramirez came on with no outs in the seventh and retired the side after allowing an RBI single by catcher Wilson Ramos that cut the lead to 4-2.

The Cubs (38-46) won their fourth in a row as center fielder Ruggiano added on an insurance run with an RBI single in the ninth to make it 5-2. Shortstop Starlin Castro (two hits) followed with a two-run single to up the margin to 7-2 against reliever Jerry Blevins.

Left fielder Chris Coghlan, right fielder Nate Schierholtz and second baseman Darwin Barney also had two hits for the Cubs, who had nine hits and four runs in seven innings against Washington starter Tanner Roark (7-6).

Chicago took a 4-1 lead in the fifth when Coghlan scored on a groundout by first baseman Anthony Rizzo.

Ruggiano hit a solo homer to lead off the third to give the Cubs a 3-1 edge.

Hammel gave the Cubs a 2-1 lead in the second when he lined a shot that glanced off Roark and the ball went into left field for an RBI single to drive in Schierholtz.

Washington right fielder Jayson Werth tied the game at 1-1 with a solo homer with two outs in the first. It was the second game in a row with a homer for Werth, who also doubled in the eighth but was stranded against Cubs reliever Pedro Strop with the outcome still in doubt at the time.

The Cubs took a 1-0 lead in the first as Coghlan, who had singled, scored on a double play grounder off the bat of Rizzo.

Hammel and Roark both entered the game with a record of 7-5 and an ERA of 2.98. Roark, a product of the University of Illinois, was pitching against the Cubs for the first time at Nationals Park and the third time overall. He entered Friday with a lifetime ERA of 1.28 at Nationals Park in 70 1/3 innings.

The game drew 41,274 fans, the most ever for a July 4 game at Nationals Park.

Washington left fielder Bryce Harper was hitless in four at bats with two strikeouts in the No. 2 spot in the lineup. He is 3-for-15 with six strikeouts since coming off the disabled list Monday.

NOTES: The scheduled pitchers for Saturday are Washington LHP Gio Gonzalez (5-4, 3.93 ERA) against Cubs RHP Jeff Samardzija (2-7, 2.83) ... Washington entered play Friday with a team ERA of 3.04, the best in the National League. The Nationals are second in NL bullpen ERA at 2.46 ... The Cubs entered Friday with an all-time record of 117-97-3 on July 4 games but had lost 12 of the last 15 on that holiday ... Washington entered Friday with a mark of 6-2 at home and 6-3 overall on July 4. ... The Cubs are coming off a three-game sweep at Fenway Park over the Boston Red Sox. It was the second year in a row the Cubs swept a series on the road against the defending World Series champs: Chicago swept the Giants in San Francisco in 2013.