MIAMI (AP) Max Scherzer took one look at the ball soaring toward the upper deck in right field and then spun away in disgust.
Scherzer was twice unable to hold a two-run lead, but five relievers finished the job and Sean Doolittle pitched 1 2/3 perfect innings for his 10th save.
Michael A. Taylor and Matt Adams each hit a two-run homer for the Nationals, and Bryce Harper's two-run double in the seventh broke the game open.
Scherzer (8-1) labored through six innings, allowing seven hits and four earned runs, both season highs.
''Look, mistakes happen,'' Scherzer said. ''I'm human. The younger version of me would be one to throw a cooler across the room.''
He added only four strikeouts to his NL-leading total, which now stands at 108, but still won his seventh consecutive decision.
''I've seen better from him, and he knows it,'' Nationals manager Dave Martinez said. ''But you know what? He gave us six strong innings.''
Scherzer failed to hold leads of 2-0 and 4-2. He gave up Miguel Rojas' two-out, two-run single in the fourth, and Derek Dietrich's two-run homer into the upper deck in the sixth.
''They had a good approach against me,'' Scherzer said. ''They were gunning to take away some things I could do. That's what happens when you face division opponents. They've seen me before. They know what to take away.''
Miami manager Don Mattingly agreed that his team made the Nationals' ace work.
''We stayed after him,'' Mattingly said. ''We put some pressure on him - made him throw some pitches, and got some runs.''
Scherzer was lifted for a pinch-hitter in the seventh, when the Nationals pulled ahead to stay. Trea Turner hit a tiebreaking infield single with the bases loaded against Nick Wittgren (2-1), and Harper punched a 96 mph fastball down the left-field line to make it 7-4.
''This is a great team win,'' Scherzer said. ''It shows what our offense is capable of.''
Marlins starter Jose Urena allowed four runs in six innings and is winless over his past 13 starts. The Marlins have lost all 11 of his starts this season - and 13 in a row dating to last September, a team record.
Miami third baseman Martin Prado left in the sixth inning after he pulled up limping while running out a grounder, and Mattingly said the injury deflated the Marlins.
''It seemed like the whole game went right down the tube when that happened to him,'' Mattingly said. ''Nothing went right after that.''
Prado had a single and a pair of doubles against Scherzer, hiking his career average against the Nationals' ace to .457 (16 for 35).
Harper began the weekend leading the NL with 15 homers but said he's not monitoring the competition.
''I've been watching a lot of hockey,'' he said.
The Nationals selected the contract of RHP Justin Miller, who has pitched in 82 major league games, most recently in 2016. He takes the roster spot of RHP Erick Fedde, optioned back to Triple-A Syracuse after he made a spot start for Washington.
The game was the first of 19 between the teams this year. The Nationals have won nine consecutive games in the series while outscoring Miami 62-17.
Nationals: 2B Daniel Murphy (right knee) and OF Brian Goodwin (left wrist) will begin rehab assignments Saturday at Double-A Harrisburg. Murphy, returning from offseason surgery, will be eased into action. ''We'll probably start him off with five or six innings and see how he feels, and maybe give him a day off in between,'' Martinez said. ''But he looks good.''
Nationals RHP Tanner Roark (2-4, 3.39 ERA) is scheduled to start Saturday against LHP Wei-Yin Chin (1-2, 6.55), who has allowed only two runs total in his past two starts.
More AP baseball: https://apnews.com/tag/MLBbaseball
Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.