Photos: Luka Doncic reacts to collecting a technical foul in the Mavs’ victory over the Pistons

On Saturday night, Luka Doncic became the NBA’s first player to post six consecutive 30-point triple-doubles.

The Dallas Mavericks pulled away in the second half, defeating the Detroit Pistons 142-124.

Doncic recorded 39 points, 10 assists, and 10 rebounds, breaking Russell Westbrook’s record of five consecutive 30-point triple-doubles. He also broke his own record by posting his fifth consecutive 35-point triple-double.

Dallas Mavericks guard Luka Doncic (77) reacts after being called for a technical foul...

“That just shows what level he’s playing on right now,” Mavericks coach Jason Kidd said. “He knows he can score the ball, and he’s also able to find his teammates and lastly, he’s able to rebound the ball.”Dallas Mavericks guard Luka Doncic leaves the court after a victory over the Detroit Pistons...

Kyrie Irving added 21 points for Dallas, which has won two in a row after a three-game losing streak.

Dallas Mavericks guard Luka Doncic (77) reacts after missing a shot a the final buzzer of...

Cade Cunningham scored 33 points, 10 assists, and nine rebounds for the Pistons, who have lost 10 of 12. Simone Fontecchio added a career-high 27 points but struggled against Doncic after Ausar Thompson left the game with an illness.

“That definitely had an impact,” Fontecchio said. “I had to guard him when (Thompson) went out, and I’ve said it before — he’s an elite defender.”

The Mavericks led 69-65 at halftime, helped by 21 points from Doncic in the second quarter.

Dallas Mavericks guard Luka Doncic waits for pregame introductions before an NBA basketball...

Doncic had 10 more points in the third and Dallas moved out to a 104-88 lead after Michigan star Tim Hardaway Jr. hit three 3-pointers in the final 2:16 of the period — the last, a buzzer-beater.

Dallas Mavericks guard Luka Doncic (77) celebrates after hitting a 3-pointer past Detroit...

“It’s huge for us when (Hardaway) can come in and hit 3-pointers like that,” Kidd said. “Not only did he make four, he had two chances at a four-point play.”

The Mavericks outscored Detroit 7-0 in the first minute of the fourth, extending their lead to 23 points.

Dallas Mavericks guard Luka Doncic (77) reacts after missing a shot a the final buzzer of...

“We just couldn’t score — we had seven turnovers in the third quarter — and no one played defense,” Pistons coach Monty Williams said. “We didn’t, and they didn’t.”

The game became feisty down the stretch. With 9:07 left, Stanley Umude was called for a flagrant four for striking Hardaway in the head. Then, with 7:03 remaining, Jalen Duren fouled Gafford hard as he headed to the basket, which would have been Doncic’s 10th assist. P.J. Washington lightly pushed Duren away from Gafford, who was on the floor, and Duren returned with a much heavier shove, bringing all ten players into the scrum.

Duren was expelled for a personal foul and two technicals. Washington also got a technical.

Dallas Mavericks guard Luka Doncic (77) is fouled by Detroit Pistons guard Killian Hayes (7)...

“It’s a hard foul, but that’s basketball,” Gafford said. “I don’t hold that against anyone.”

Doncic left the game immediately after getting his 10th rebound.

Dallas Mavericks guard Jalen Brunson (13) is fouled by Detroit Pistons guard Killian Hayes...

“I kept looking at the scoreboard, and he was stuck on nine for a while,” Kidd said. “The Pistons couldn’t miss.”

Dallas Mavericks guard Luka Doncic (77) brings the ball up the court during the second half...

Cunningham played Doncic very evenly in the first half, scoring 24 points, five rebounds, and four assists. Meanwhile, Dallas converted eight Pistons turnovers into 18 points.