In the middle of the first inning Thursday night Bryce Harper and Jayson Werth pulled on their batting gloves and helmets together by the bat rack. In the Washington Nationals’ dugout they gave one another the usual pump-up speech — “Come on let’s get him whatever” Werth said later. Harper’s mind drifted to his home run total.

“I need one more for 20” Harper said. “I want 20.”

“Play to win” Werth replied “and you’ll get everything you want.”

Werth would think back to that conversation minutes later as he rounded third. Harper’s laser into the front row over the right-center field fence provided the entirety of the Nationals’ scoring in a 3-2 victory over the Miami Marlins which left them five games behind the Cincinnati Reds with nine to play. As Werth hit home plate he turned around and saw Harper looking at him grinning ear-to-ear.

“It made me smile too” Werth said. “It was just one of those things. We were just talking about this.”

Harper chuckled as he crossed home a 20-year-old who could not conceal his happiness over a significant home run. Werth patted Harper on the head like a big brother as they walked back to the dugout.

Harper has endured much in his second major league season playing through pain and ­mini-controversies. But lately he has been able to enjoy it too. As Denard Span’s hitting streak ended and Gio Gonzalez went six innings on his 28th birthday for his 11th win Harper went 3 for 4 and launched his 20th home run.

Harper became the second player with two 20-home run seasons at age 20 or younger. He joined Tony Conigliaro whose age-20 season came in 1965. Harper’s milestone offered a reminder of just how special a player he can be.

“When you go through a period where you have all this attention and you try to live up to hype and you try to do things you try to do too much” Manager Davey Johnson said. “He’s getting over that. I think he’s back to enjoying the game and that’s great to see.”