CLEVELAND — Mets rookie Pete Alonso has a million-dollar swing.

New York’s newest slugger outlasted a worn-down Vladimir Guerrero Jr. in the final round of the All-Star Home Run Derby on Monday night to win $1 million — nearly double his 2019 salary.

Alonso somehow had enough to edge Guerrero, who hit 91 homers but ran out of gas in the last round following an epic semifinal matchup against Dodgers outfielder Joc Pederson.

Needing 23 homers to beat Guerrero, Alonso connected for a homer to left-center before flipping his bat high into the air and hugging his pitcher, cousin Derek Morgan. Alonso was then swarmed by the NL All-Stars who were treated to a power display unlike any in the event’s history.

“This was surreal,” Alonso said.

Alonso is the second rookie to win outright, following Yankees star Aaron Judge in 2017. He’s also the first Mets player to win the derby since Darryl Strawberry shared the title with Wally Joyner in 1986.

Alonso, making the major league minimum of $555,000 this season, has hit 30 home runs. He’ll showcase his swing again in Tuesday night’s All-Star Game as baseball continues this season of the longball.

One of the only bright spots this season for the struggling Mets, Alonso gave New York’s NL fans something to brag about while the Yankees chase another title.

Alonso showed some dramatic flair with two nail-biting wins to reach the final against Guerrero. He nipped Cleveland’s Carlos Santana 14-13 in the first round and Atlanta’s Ronald Acuña Jr. 20-19 in the second to set up a showdown with the 20-year-old Guerrero, whose father won the event in 2007.

With one of baseball’s most fearsome swings, Guerrero figured to be a force but there was no way of predicting he’d hit 91 homers — 74 more than his dad’s entire total 12 years ago.

But Alonso was up to the challenge, and shocked Guerrero, who had electrified a crowd of 36,199 fans while also destroying an on-field camera with one of the balls he didn’t crush over the all.

Guerrero defeated Pederson in a semifinal that required three extra swing(ings) and will go down in derby lore.

They were tied 29-all after their four-minute round and then again following a 60-second session. Guerrero and Pederson then each homered once when given three swings, forcing another best-of-three round.

Guerrero hit two, screaming at his second shot, which barely cleared the 19-foot high wall in left. Pederson couldn’t match up, hitting a grounder on his final cut before both players shared an exhausted embrace near home plate as the fellow All-Stars stood and applauded like regular fans.

The last Home Run Derby in Cleveland was also won by a New Yorker — Yankees first baseman Tino Martinez, who took the 1997 crown over a field which included Hall of Famers Ken Griffey Jr. and Jim Thome, who didn’t clear the walls once.

Santana fared better than Thome, hitting 13 dingers in the first round. But Alonso rallied with two homers in the final 15 seconds to hit 14 as the Cleveland crowd sneered.

The derby lost its top seed on Sunday as Christian Yelich, the reigning NL MVP and current home-run leader, withdrew from the contest citing a nagging back issue. Yelich didn’t want to risk injury and his decision was certainly welcomed news to the Milwaukee Brewers.

Yelich, who is still playing in Tuesday’s game, was replaced by Oakland’s Matt Chapman, who had the misfortune of being paired against the hard-swinging Guerrero in the first round.

Guerrero mashed 29 homers in the first round, breaking Josh Hamilton’s record at Yankee Stadium in 2008, and the barrage included a 476-footer that nearly stuck like a dart into scoreboard in left field.

As each of Guerrero’s powerful swings sent a ball sailing into the darkening sky, the sellout crowd at Progressive Field oohed and aahed as if watching a Fourth of July fireworks display.

Chapman only managed 13, but he did connect on one that went a foot further (477 feet) than Guerrero’s deepest shot.

Acuna got off to a slow start, but after calling timeout, he slowed his swing and the right-hander began driving the ball to the opposite field, recording 25 homers to eliminate Pittsburgh’s Josh Bell, who never got into a rhythm and hit 18.

Pederson opened the event with an impressive 21 homers to beat Houston’s Alex Bregman (16).

When the ballpark gates opened at 5:30 fans, most of them wearing gloves, scrambled down the concourses to secure prime standing-room-only spots along the railing above the left-field wall and behind the lower bowl seats in right.

They were hoping to see some moon shots, towering drives and monstrous blasts from a group that didn’t disappoint with 322 total homers.