SAN ANTONIO — The Dallas Mavericks were not rattled when a disastrous start to the fourth quarter threatened to dismantle a game they thoroughly dominated to that point.

Having Luka Doncic and former Knick Kristaps Porzingis on offense tends to ease such tension.

Doncic had 26 points, 14 assists and 10 rebounds, and Porzingis added 28 points and 12 rebounds as Dallas powered past the San Antonio Spurs 109-103 on Wednesday night.

Doncic had his 13th triple-double of the season, giving him 21 for his career to tie Jason Kidd for Dallas’ franchise record.

Donic, who turns 21 on Friday, shrugged when told of the record. He was happier the Mavericks overcame a rough start to the final quarter and snapped a four-game skid in San Antonio.

“It’s tough to play here,” Doncic said. “You can see we’re learning. It’s not always going to be perfect, but we’re learning.”

Dallas is 13 games above .500 for the first time this season.

DeMar DeRozan had 27 points, nine assists and eight rebounds to lead the Spurs, who lost for the seventh time in nine games after going 2-6 on their annual Rodeo Road Trip.

The Mavericks scored only one point in the first six minutes of the final quarter, threatening their dubious league record of two points scored in a quarter in 1997.

Trey Lyle’s 3-pointer with 6:16 put the Spurs up 90-89, their first lead since the opening minute of the first quarter.

Losing the lead roused Dallas, who outscored San Antonio 18-7 over the next four minutes to regain control.

“They picked up the heat on defense,” Mavericks coach Rick Carlisle said. “We didn’t execute the way we had been earlier in the game, and they made a run. We had to respond, and we did.”

Doncic and Porzingis, 24, combined for 11 points, five assists and two rebounds in the final six minutes of the fourth.

San Antonio forward LaMarcus Aldridge sat out with a sore right shoulder, missing his bobblehead giveaway night. Marco Belinelli added 14 points and Lonnie Walker IV had 12 points while starting in place of Aldridge.

The Mavericks, Porzingis and Doncic particularly, quickly took advantage of the Spurs’ smaller lineup.

“It’s just experience playing with each other and getting to know each other and little details about the game,” Porzingis said of playing with Doncic. “I feel like also me playing at the five now more I’m more involved with him in the pick and rolls and not standing around on the perimeter as much. I’m more involved rolling, popping (and) then I have the option to pick what I want to do and play off of Luka. We have a better rhythm now.”

Porzingis and Doncic combined to score the Mavs’ first nine points.

Porzingis scored 16 points in the first quarter on 3-for-4 shooting, including a 27-footer that stunned the crowd. Dallas led 36-20 at the end of the period.

The Spurs shot 29 percent in the first quarter and finished three points shy of their season low for scoring in the opening period.

“I think the game plan that I came out with was poor, and they took advantage of it in the first quarter,” San Antonio coach Gregg Popovich said, “And we turned it over nine times in the first half. So, that got us in a hole, but you know they’re a hell of a team and I’m really proud of the effort and stick-to-itiveness”