Freddie Freeman’s Braves lead Bryce Harper’s Nationals by 5.5 games in the National League East, but Harper won the head-to-head battle Monday night.

The long-time rivals were matched against each other in the first round of the home run derby during All-Star week. Harper was a No. 2 seed, Freeman a No. 7.

Harper won, 13-12, not needing all his allotted time to win. Freeman was serenaded with boos at every opportunity, while the home crowd exploded at every turn for Harper.

“My hands are sweating already,” Freeman said before the derby. “(Harper’s) making me nervous, trash-talking me. We’ve had a lot of fun and we’ve been competing against each other for a long time, and doing this, it’s a dream come true.”

Harper went on to hit nine home runs in 47 seconds to draw even with Kyle Schwarber in the finals. He hit the tying homer as time expired, then walked it off in his earned extra time, 19-18.

Freeman’s longest homer was 437 feet. He had three at the 1:55 mark of the four-minute period, and he elected to use his timeout. He clubbed three straight shots to left center following a short break.

He appreciated, and fully expected, the chorus of boos.

“That was nice,” he said. “I figured I was going to get a reception like that. ... It just means I’ve done well here.”

Braves infield instructor Tomas Perez pitched to Freeman.

Freeman, 28, was the oldest participant in this year’s derby. He’s the first Brave to take part in the derby since Andruw Jones in 2005. Jones hit five that year, tied for the most in Braves history (though the changing formats make it an uneven comparison).

Harper’s longest homer went 467 feet, with several balls deep into the right field seats. He hit five of the 10 longest homers of the first round. Javy Baez hit the longest at 479 feet.

After Harper’s last homer, Freeman gave him a big hug. He referred to Harper as “one of the best players in our game” afterward, and said he expects the Nationals and Phillies to hang around in the division race until the end.

In lighter comentary, Freeman said Sunday he’d hoped to beat friend Chipper Jones’ marks. Jones hit six homers across three derbies.

“I had four minutes, I think he had 10 outs,” Freeman said. “Maybe we’ll hold another one, just me and him, even though he’s (46).”

Freeman is one of four Braves All-Stars. He’ll start at first base and hit fourth for the NL in Tuesday’s game. Freeman was the NL’s leading vote-getter, while teammate Nick Markakis was second.