MIAMI (AP) Trea Turner welcomed back manager Dave Martinez with two big swings.
Washington stayed one game ahead of Milwaukee for the top spot in the NL wild-card standings. The Nationals had dropped four of six.
''I felt I've been seeing the ball pretty decent,'' Turner said. ''Today all four at-bats, I had a good approach. The swing and timing was there as opposed to the last series. I feel good and hopefully roll it into tomorrow and keep going.''
Martinez rejoined the Nationals following a heart procedure that caused him to miss a three-game series at St. Louis. The 54-year-old was back in the dugout four days after a cardiac catheterization.
''I love being back,'' Martinez said. ''Much better being in the dugout - a lot of fun. I enjoy every minute of it. Just watching these guys every day and what they do and how they go about their business, they have a good time. They play for each other, which is nice.''
Before Miami's 100th loss, the team announced manager Don Mattingly had agreed to a two-year extension. Mattingly was in the final season of a four-year contract.
The Marlins became the third team to lose 100 games this season, joining the Baltimore Orioles and Detroit Tigers. Miami also had 100-loss seasons in 1998 and 2013.
''We are going to be playing some good teams and teams that are in the playoffs (hunt) and that is good for us from the standpoint (of) motivation for us,'' Mattingly said.
The Nationals grabbed the lead for good on Asdrubal Cabrera's three-run homer off Robert Dugger (0-3) in the fourth inning.
Turner's 15th homer gave Washington a 1-0 lead in the third. After Miami pulled within one in the sixth, Turner connected against Ryne Stanek in the seventh.
Anibal Sanchez (10-8) pitched five-plus innings to reach double-figure victories for the fifth time in his career. Sanchez allowed four runs and six hits.
Fernando Rodney pitched a perfect seventh and Daniel Hudson got six outs for his fifth save in nine opportunities.
Starlin Castro homered for Miami and finished with three hits. Isan Diaz and Jon Berti each had two hits and drove in a run.
Dugger was charged with four runs and three hits in five innings in his sixth major league start.
Victor Robles' RBI single gave Washington a 5-2 lead in the sixth, but Miami rallied in the bottom half. Diaz singled home Neil Walker, and Castro scampered home on reliever Wander Suero's errant pickoff throw to first.
Hudson recorded a two-inning save for the second time in three games. He allowed three hits and threw 19 of his 28 pitches for strikes.
Hudson was working with a pitch count of 30, and Martinez planned to pull the reliever after Miguel Rojas' at-bat. Hudson got Rojas to ground into a game-ending double play.
''I had a couple of days off, I didn't throw Wednesday and had an off day (Thursday) so I felt fine,'' Hudson said. ''I try to go out there and get as many outs as they want me to get.''
The Nationals greeted Martinez with hugs when he met them in the dugout before Friday's game.
''Our main concern was his health and we are so happy he is back,'' Robles said. ''We felt his absence. He is a manager who always motivates us. You can sense it when he is in the dugout.''
Nationals: 1B Matt Adams (sprained shoulder) continues to take batting practice but without a timeline for his return.
Nationals: RHP Stephen Strasburg (17-6, 3.49 ERA) has a 21-7 career record against Miami, including 3-0 this season.
Marlins: RHP Jordan Yamamoto (4-5, 4.87 ERA) will make his first start since being activated from the injured list. Yamamoto was sidelined because of a right forearm strain.
Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.