MIAMI — Barry Bonds was very impressed with Jose Fernandez’s performance.

Bonds, the Marlins’ hitting coach, was among those in the dugout congratulating Fernandez at the end of his outing, grabbing him with both hands and kissing him repeatedly on both cheeks.

“I love you!” Bonds shouted as Fernandez grinned.

Fernandez pitched eight innings and struck out 12 to help the Miami Marlins to a 1-0 victory over the Washington Nationals on Tuesday night that took just 2 hours, 11 minutes.

“That goes way back, it’s a long story,” Fernandez said with a smile about his connection with Bonds. “It’s impressive. Everybody knows who he is and what he has done in this game. When I was walking in here now he told me, ‘It was the best that I have seen you pitch. I’m impressed.’ To get that from probably one of the best hitters in the history of the game means the world.”

Fernandez (16-8) allowed three hits without a walk to outduel Washington’s Tanner Roark (15-9) who pitched seven innings and allowed one run.

“I thought it was the best game he has thrown all year,” Marlins manager Don Mattingly said of Fernandez. “He used his changeup early in the game and that was a weapon for him all day to keep them off-balanced.”

Roark went at least seven innings while allowing one run or fewer for the 12th time this season in his battle against Fernandez, who improved to 29-2 in his career at home.

“I know Jose is good here at home so it was me versus him, not me versus the hitters,” Roark said.

David Phelps pitched the ninth for the Marlins and recorded his fourth save in 10 chances as Miami won its third straight.

“In the situation we’re in what you would really like to do is win every game and force whoever we’re behind to win every game — to have to win theirselves in,” Mattingly said.

The Nationals were held to four hits in their fourth consecutive loss.

Bryce Harper returned to the starting lineup for Washington after getting the day off on Monday and went 0 for 4.

“We had a couple times when Bryce hit the ball a ton,” Nationals manager Dusty Baker said. “That’s a good sign when he hits the ball on a line like that. It’s tough to stay with him and stuff but he’s right there, right around the corner. He’s frustrated, we’re all frustrated especially when you’re not scoring runs.”

Stanton’s 27th home run broke a scoreless tie in the bottom of the sixth inning. Stanton also homered in Monday’s 4-3 win.

“It was just a good swing, good contact-type ball,” Stanton said. “It wasn’t like a hard drive or anything. Just a good bat path to a ball out over the plate.”

Stephen Drew smacked a double off the top of the right field fence over Stanton’s head in the first inning before Fernandez retired the next 21 batters.

Wilson Ramos broke through in the top of the eighth with a soft liner to center and Brian Goodwin followed with a single to right.

Fernandez struck out Danny Espinosa and got pinch-hitter Daniel Murphy to ground out to get out of the jam and cap his outing.

“He was good, he was feeling it,” Stanton said. “He knows how important each and every game is and he wanted to make sure he put it away today.”

TRAINER’S ROOM

Nationals: Baker denied a report about Harper dealing with a shoulder injury. “The story was inaccurate,” Baker said. “They asked me about the shoulder problem before and I said we gave him four or five days off. I don’t even know how long ago that was, six weeks ago or something like that? And to say he’s playing shallow because he couldn’t throw the ball is totally inaccurate. I don’t know where they got that from. I know they got some quotes from me, but I was talking about the past. I wasn’t talking about the present. I don’t know how it came out because I don’t read much, but that was inaccurate reporting. Nobody knows where it came from because he’s not on the injury report and we treated that already in the past.” … 2B Murphy (left leg soreness) was held out of the starting lineup for the third consecutive game.

Marlins: RHP Bryan Morris (lumbar disc herniation) was reinstated from the 60-day DL and was designated for assignment.

UP NEXT

Nationals: RHP Max Scherzer (17-7, 2.78 ERA) will start Wednesday’s series finale with the Marlins. Scherzer is 4-0 with a 1.47 ERA in his last five starts.

Marlins: RHP Tom Koehler (9-11, 3.96) takes the mound looking for his first win since Aug. 9 against San Francisco.