DETROIT (AP) — Saddiq Bey scored 10 of his 20 points in the final 4:23 as the Detroit Pistons pulled away down the stretch and beat the Philadelphia 76ers 102-94 on Thursday night.

Cade Cunningham scored 27 points for Detroit, which snapped a three-game losing streak and had a 39-8 edge in scoring off the bench.

READ MORE: Father Of 18-Year-Old Killed In Sand Collapse On Toms River Beach Shares Message Remembering Son

Joel Embiid had 37 points and 15 rebounds and James Harden finished with 18 points, nine rebounds and seven assists for the 76ers.

Detroit didn’t lead until the fourth quarter, and Isaiah Livers’ 3-pointer with 5:05 left gave the Pistons a 90-87 advantage. After Harden missed, Bey made it 93-87 with another 3-pointer, forcing Sixers coach Doc Rivers to call a timeout.

Embiid answered with a dunk, but Bey scored seven points in a 9-0 run that gave the Pistons a 102-89 lead with 1:54 to play.

Embiid had 18 points and nine rebounds in the first half, going 10 for 11 from the line. Philadelphia attempted 20 free throws in the half compared to four for Detroit. But the Pistons’ 21-0 advantage in bench points kept them within 54-50.

Detroit stayed close through most of the third, but Embiid dunked over Cunningham and Isaiah Stewart to give the Sixers a 79-73 lead going into the fourth. He had 15 points and six rebounds in the quarter, giving him 33 points and 15 rebounds.

READ MORE: Former Giants CB James Bradberry Agrees To Terms On 1-Year Deal With Philadelphia Eagles

Marvin Bagley III left the game in the third quarter with a hip injury after landing awkwardly while being fouled by Embiid.

TIP INS

Sixers: Shake Milton’s 3-pointer with 4:03 left in the third quarter was the first basket from Philadelphia’s reserves after the starters had scored the first 69 points.

Pistons: Cunningham could become part of a very rare double. No city has swept the NHL and NBA Rookie of the Year awards since Ray Bourque and Larry Bird did it in Boston in 1980, but Cunningham could join defenseman Moritz Seider or forward Lucas Raymond of the Red Wings, two of the leading candidates for the Calder Trophy.

UP NEXT

Sixers: Host the Charlotte Hornets on Saturday.

MORE NEWS: Pennsylvania US Senate Race Between Republicans Mehmet Oz, Dave McCormick Too Close To Call

Pistons: Visit the Oklahoma City Thunder on Friday.