WASHINGTON -- For Bryce Harper, home is where the hardware is.

Wearing a District of Columbia flag bandana in front of his hometown fans, the Washington Nationals star finished the final round of Monday's Home Run Derby with 19 homers at Nationals Park the night before the All-Star Game, winning the contest dramatically in bonus time over Chicago Cubs slugger Kyle Schwarber.

It was the second Home Run Derby for Harper and the first for the rest of the field. Harper lost to Yoenis Cespedes in the 2013 final at Citi Field in New York.

At the 2015 All-Star Game, when Reds slugger Todd Frazier won the Derby in Cincinnati, Harper vowed that when the contest came to the nation's capital, he would compete. He did that and more, joining Frazier and Cubs great Ryne Sandberg (1990) as the only players to win the Home Run Derby at their home parks.

To pull off the feat, Harper had to mount an improbable comeback. With less than a minute left in the final round, the Nats slugger trailed Schwarber 18-9. Then, with AC/DC's "You Shook Me All Night Long" blaring throughout the stadium, Harper sent eight straight offerings and nine of 10 from his father over the fence to tie it up. On his second swing of bonus time, which he earned by belting a 473-foot shot in regulation, Harper hit No. 19 to send the home crowd into a frenzy.

Thanks big man! Great to compete against you! #classact https://t.co/yGWucLzMMg — Bryce Harper (@Bharper3407) July 17, 2018

Immediately afterward, Harper was quick to compliment his father, Ron, who served as his son's pitcher, just as he did five years ago.

"I knew he was going to be locked in," said Harper, who entered the All-Star break with 23 homers, tied for second in the National League. "He hit my barrel nine straight or something like that. I couldn't be more fortunate to have him throwing to me. So blessed. I've got one of the best families in all the world."

Harper's father, who has dealt with shoulder problems recently, was happy to help his son go all the way after falling short the first time around in New York.

"In 2013, I struggled a little bit," Ron Harper said. "I think I hit him. I threw a lot of bad pitches, but I scooted up a little bit this year. I got eight anchors in my shoulder. Had a couple shoulder surgeries. He took a few years, and that's what he wanted to do, and I said I'd be ready. I was fortunate enough for him to ask me to do it, and I was happy I could at least get locked in for a minute and get him over that hump. I was worried, like, 'Oh, don't screw this up for both of us.' But he came through. He did great. So I'm really proud of him. I love him to death, man. He's a great kid. You couldn't ask for anything better."

Before besting Schwarber in the final, Harper beat Atlanta Braves first baseman Freddie Freeman 13-12 in the first round then topped Los Angeles Dodgers sensation Max Muncy by the same score in the second round. Schwarber advanced to the final round with a dramatic 21-20 win over Philadelphia Phillies outfielder Rhys Hoskins in the semis.

Also in the first round, Schwarber beat Houston Astros infielder Alex Bregman, Hoskins won against Milwaukee Brewers first baseman Jesus Aguilar, and Muncy bettered Cubs infielder Javier Baez.

Schwarber and Baez were the 18th pair of teammates to enter the Derby. The Cubs also had two players in the competition in 2015, when Kris Bryant and Anthony Rizzo competed in Cincinnati.

On Monday, after falling victim to Harper's epic comeback, Schwarber said he had a good feeling that it was the former MVP's night.

"As soon as I got done with my [final] round, I told myself that he had it," Schwarber said. "I knew he had the home crowd behind him, and he's a prolific power hitter with a great swing. For him to come in and do that, it was getting close to the wire, then all of a sudden, he started racking them off one at a time. You just accept your fate there."

Schwarber said he told Harper that if they both ended up in the final, "the whole crowd would be against me."

Harper, a free agent at the end of the season, thanked the home crowd and the Nationals organization for their support.

"This wasn't only for me and my family and everybody like that, but this is for, you know, the cook, the guy that works the front and the people that work upstairs," Harper said. "I mean, this is the whole city of D.C. I was very fortunate to be able to bring this back to them and do it here."

Information from The Associated Press was used in this report.