(Detroit) The Detroit Pistons ended their 28-game losing streak – the longest in NBA history – by defeating the Toronto Raptors 129-127 on Saturday.

The Pistons, who hadn’t won since Oct. 28, tied the Philadelphia 76ers’ record for mediocrity, with 28 losses spread across the 2014-15 and 2015-16 seasons.

Cade Cunningham had 30 points and 12 assists in the win. Jalen Duren had 18 points and 17 rebounds and Kevin Knox II scored 17 points.

Pascal Siakam had 35 points and Dennis Schröder 28 for the Raptors, who were playing their second game in two nights.

The Raptors traded OG Anunoby, Precious Achiuwa and Malachi Flynn to the New York Knicks earlier today. They got R. J. Barrett and Immanuel Quickley in return, but they were unavailable for this game.

The Pistons led 90-86 early in the fourth quarter and neither team was able to take the lead before Cunningham and Jaden Ivey hit back-to-back shots from downtown to make it 110-99 with 5:50 to play.

The Raptors scored eight of the next 10 points, including six by Scottie Barnes. Cunningham, however, made a jumping shot which gave the Michigan club a nine-point lead.

Siakam cut the lead to 126-122 with a three-pointer with 17 seconds left. Gary Trent Jr. then added three points with one second on the clock.