DALLAS (AP)Luka Doncic thought his improbable tying basket in the final second of regulation actually won the game.

No biggie. The Dallas superstar just set the table for a triple-double unlike the NBA has ever seen.

Doncic had a franchise-record 60 points, 21 rebounds and 10 assists, including the tying basket off his intentionally missed free throw to force overtime, as the Mavericks rallied for a wild 126-121 victory over the New York Knicks on Tuesday night.

After grabbing the loose ball on a rebound and shooting the 11-foot jumper in one motion, the 23-year-old danced around while waving his arms as the thinned-out crowd expecting a loss celebrated wildly.

It was 115-115 with 1.0 seconds remaining.

”A lot of people asked me about this back in the locker room, and I said I thought we won it,” Doncic said. ”That’s why I went to the crowd like this. I thought we won the game, and then I see it’s tied. I was like, `Oof.”’

Dallas was down nine with 33 seconds left in regulation before getting even in a back-and-forth sequence capped by Doncic grazing the rim and hitting the backboard with the intentional miss.

The first 60-point game in Dallas history also included Doncic’s career high in rebounds and was the first 60-20-10 game in NBA history. The young Slovenian had his seventh triple-double and the league’s highest-scoring performance of the season.

The Mavericks moved three games over .500 with a fourth consecutive victory, both marks matching their season bests.

Quentin Grimes scored a career-high 33 points and Dallas native Julius Randle had 29 points and 18 rebounds for the Knicks, who lost a fourth consecutive game coming off an eight-game winning streak, their longest in almost nine years.

Jalen Brunson missed the game with a hip injury, unable to play in what would have been his return to Dallas.

New York was essentially without two starters after RJ Barrett exited with a cut on a finger 96 seconds into the game, but trailed for less than a minute in regulation.

”I thought we were playing well,” Knicks coach Tom Thibodeau said. ”Didn’t close out the last 30 seconds of the game.”

After Miles McBride missed one of two free throws with 11.5 seconds left, Spencer Dinwiddie, who scored 25 points, hit a 3-pointer to get Dallas within 113-112.

McBride made both free throws the next time for a 115-112 lead with 7.7 seconds to go, then Grimes fouled Doncic before the Dallas superstar could attempt a potential tying 3-pointer.

Doncic made the first free throw before the miss with 4.2 seconds to go, then ended up with the ball after it bounced off several sets of hands.

”I know it was two seconds or something,” Doncic said. ”I just threw it up, hopefully it went in.”

The teams combined to miss the first nine shots of overtime, all the points coming on free throws before Doncic hit a jumper for a 122-117 lead with 1:08 remaining.

Doncic was 21 of 31 from the field and 16 of 22 from the line while topping Dirk Nowitzki’s previous club record of 53 from Dec. 2, 2004.

The 23-year-old’s record night came two days after the Mavericks unveiled a statue of Nowitzki outside the arena.

”I’m tired as hell,” Doncic said after playing all but 12 seconds of the second half and overtime, and 49 minutes overall. ”I need a recovery beer.”

Dallas led for less than a minute of regulation but never trailed in overtime. Doncic put the Mavs ahead for good at 118-116 with two free throws midway through the extra period.

Brunson missed his first game of the season in his first visit to Dallas, where the point guard spent his first four seasons before signing with the Knicks in free agency last summer.

The two-time NCAA champion from Villanova got to play against his former team in early December in New York, when the Mavericks rolled to a 121-100 victory.

TIP-INS

Knicks: Starting for Brunson, Immanuel Quickley had a career-high 15 assists and scored 13 points. … Mitchell Robinson had a season-high 20 points and 16 rebounds.

Mavericks: F Dorian Finney-Smith will miss at least two more weeks with a right adductor strain that has sidelined him the past four games. … Christian Wood had 19 points and nine rebounds.

UP NEXT

Knicks: At San Antonio on Thursday as New York hits all three Texas cities. The Houston visit finishes the three-game trip Saturday.

Mavericks: The Rockets at home Thursday in the first of two meetings in five days. The rematch in Houston is Monday.

More AP NBA: https://apnews.com/hub/nba and https://twitter.com/AP-Sports