For the Yankees’ Aaron Judge, Monday night’s All-Star Home Run Derby was another reason for the big rookie to smile. Associated Press/Lynne Sladky

MIAMI — Aaron Judge dominated the All-Star Home Run Derby in the same manner he has smashed his way through his rookie season.

The larger-than-life New York Yankees slugger beat Minnesota’s Miguel Sano 11-10 with two minutes to spare in the final Monday night, reaching 513 feet and displaying remarkable power to all fields.

Judge, 6-foot-7 and 282 pounds, sprayed balls off the glass behind left field that supports the Marlins Park retractable roof, hit one over the Red Grooms home run sculpture in left-center, over the batter’s eye in straightaway center and, unusual for a derby, several to the opposite field, too. He also hit the roof near a light bank in left, 160 feet above the field. That drive didn’t count.

Hitting second each time, Judge knocked out Miami’s Justin Bour 23-22 in the first round and beat Los Angeles Dodgers rookie Cody Bellinger 13-12 in the second. Then, with lightning visible behind the huge glass door, he hit a 458-foot drive to center for the title.

The Twins’ Miguel Sano got all the way to the final before falling short against Aaron Judge. Associated Press/Lynne Sladky

Judge leads the major league with 30 home runs and some Yankees fans showed up to support him in their full dress — flowing black robes and white powdered wigs. Booed initially by the crowd of 37,027, Judge earned their cheers once defending champion Giancarlo Stanton of the Marlins was eliminated in the first round.

Judge has hit the longest home run in the regular season this year in the majors — 495 feet. He’s also broken a TV monitor at Yankee Stadium with a long drive and dented a door casing.

In Tuesday night’s game, he’s set to bat third for the American League.

Sano beat Kansas City’s Mike Moustakas 11-10 in the opening round, reaching 470 feet, and the Yankees’ Gary Sanchez hit 17 that included a drive off the glass measured at 483 feet.

The Marlins’ Giancarlo Stanton, the hometown favorite and the defending champion, went out in the first round of the home run derby. Associated Press/Lynne Sladky

Stanton, who got home at about 5 a.m. after a game in San Francisco, started slowly against pitcher Pat Shine, hitting three liners before a 429-foot drive to center. Stanton began to find his grove and hit a 496-foot shot off the glass behind the left-field seats, then started spraying impressive drives. He had 15 when his 30-second bonus road started but added just one more. The crowd groaned when his last fell short.

Cody Bellinger, facing his dad, former big leaguer Clay Bellinger, earned bonus time as four minutes expired with his 13th drive, into the right-field upper deck, then with five seconds remaining knocked out Charlie Blackmon 15-14.

Aaron Judge displayed power to all fields and hit one ball 513 feet as he won the All-Star Home Run Derby on Monday night in Miami. Associated Press/Wilfredo Lee

Hitting without batting gloves, Bour excited the hometown fans with 19 homers in four minutes and then added three in bonus time.

Judge, hitting against his regular BP pitcher, Danilo Valiente, had 22 through four minutes, according to the scoreboard, and when he hit one in bonus time he walked away. But scoreboard reverted to 22 — apparently the roof shot was subtracted — and Judge added another with a few seconds left.

Seeming tired, Sanchez opened the second round with 10 and Sano needed just 3:10 to hit 11, the longest at 491 feet. In a matchup of the leading candidates for rookies of the year, Bellinger hit 12 and Judge topped him with a minute to spare, including a 513-foot shot high off the window, a drive that left his bat at 119 mph and rose 143 feet.