MIAMI --Bryce Harper homered twice for the first time in his career, and the first-place Washington Nationals snapped a five-game losing streak by beating the Miami Marlins 8-4 on Wednesday night.

Harper hit a two-run homer in the fourth inning and added a solo homer in the fifth, giving the rookie 14 this season. He had a chance for a three-homer night but grounded into a double play in the ninth, spiked his helmet in frustration after crossing the bag and was ejected by umpire C.B. Bucknor.

Before the game, manager Davey Johnson called a brief team meeting, which he described as upbeat. The pep talk stirred the Nationals' bats, and they had 14 hits.

Michael Morse had an RBI single and drove in another run with his first triple since 2010 for the Nationals. Kurt Suzuki hit his first homer with Washington in the ninth off Heath Bell.

The Nationals totaled only six runs during the losing streak, which matched their longest of the season and reduced their NL East lead over second-place Atlanta from seven games to four.

Ross Detwiler (8-6) allowed three runs in 5 2/3 innings. Drew Storen came on with runners at second and third in the eighth and retired three consecutive batters to protect a 6-4 lead.

Miami rookie Jacob Turner (0-2), auditioning for a job next year, allowed five runs in five innings. The start was his second with the Marlins after he was acquired from Detroit in a July trade and spent a brief time in their minor league system.

Turner retired the first nine batters, striking out four, but the Nationals scored four runs in the fourth. Jayson Werth led off with a single, and Harper hit his 13th homer. Adam LaRoche singled, Morse tripled and Ian Desmond hit an RBI single.

In the fifth inning, Harper homered into the seventh row of the upper deck in right field. The estimated distance was 425 feet.

The Marlins trailed 6-4 in the eighth when they put runners at second and third with none out. Storen entered the game, and Miami failed to score when Carlos Lee flied out, Giancarlo Stanton struck out and Justin Ruggiano grounded out.

Stanton doubled in the fifth and scored on a sacrifice fly by John Buck. That was the Marlins' first run ever off Detwiler, who had pitched 16 consecutive scoreless innings against Miami over five games.

Three of the Marlins' RBIs came without a hit, but they went only 1-for-9 with runners in scoring position -- a season-long problem.