TORONTO -- Reggie Bullock scored a buzzer-beater as the Detroit Pistons rallied from a 19-point deficit to defeat the Raptors 106-104 Wednesday night, making a winner out of coach Dwane Casey in his return to Toronto.

Toronto seemed to have the game in control for the first three quarters but fell behind after a furious fourth-quarter fightback by Detroit and lost its second straight.

Blake Griffin led Detroit with 30 points.

Kawhi Leonard had 26 for Toronto while Pascal Siakam added 17 and Greg Monroe 14. Kyle Lowry had 14 points and seven assists.

Trailing by as many as 19, Detroit cut the Toronto lead to 11 going into the final quarter. A 23-9 Pistons run to open the quarter gave the visitors a 100-97 lead with less than five minutes remaining.

A Leonard layup made it a one-point game with 3:19 remaining. And he added a free throw to tie the game at 100-100.

Buckets by Griffin and Andre Drummond made it 104-100 before Lowry scored via layup. Leonard hit a shot to tie it at 104-104. Griffin missed a shot and the Raptors called a timeout with 10 seconds remaining.

Leonard headed to the basket but lost the handle and the ball slipped away with two seconds remaining. Siakam prevented the winning bucket by blocking an attempted alley-oop by Glenn Robinson III.

Detroit (7-6) had 1.2 seconds left to score and Bullock sank a shot from the corner for the win.

The Raptors (12-3) came into the game looking to match their best-ever start over 15 games (13-2), set in 2014-15.

Toronto had won six straight against Detroit since 2017, its longest winning streak in the series. The Raptors have won or tied the season series with the Pistons since 2012-13.

Casey drew a crowd, both at the Pistons' morning shootaround and his pre-game availability.

And he was given a standing ovation by the Scotiabank Arena crowd during the Pistons introductions. Lowry came over to the visitors bench to give him a big hug prior to tip-off.

The Raptors paid tribute to Casey on the video board during a first-quarter timeout. Casey was busy at the Pistons bench drawing up a play but waved to the standing crowd, mouthing thank you as the tribute wound down. Lowry and Jonas Valanciunas were among the Raptors players applauding at mid-court.

The Raptors did not let sentimentality cloud their game. Leonard and Lowry hit their first six shots combined.

Leonard was good on his first four shots and drew a foul on his fifth attempt and fed Siakam, resplendent in sea-foam green sneakers, rather than score himself after a steal.

The Raptors were without the injured Serge Ibaka (right knee soreness) and Valanciunas, starting at centre, was tagged with a pair of fouls in the first quarter. That prompted an early appearance for Monroe who delivered 10 points in 12 first-half minutes.

Toronto's shooting cooled as the first quarter wore on but the home team led 31-25 after the first quarter. Toronto's O.G. Anunoby had the crowd on its feet early in the second with a thundering dunk over the six-foot-11 Drummond and Leonard offered more of the same with a dunk on a three-on-none rush.

The Raptors extended their lead in the quarter and led 65-53 at the break. Toronto shot just 2-of-11 from three-point range (compared to 6-of-17 for Detroit) in the half but had a 30-20 edge in rebounds over the Pistons, a good rebounding side, and had a 44-28 edge in points in the paint.

A 5-0 run at the start of the third extended Toronto's lead to 17. Danny Green headed to the Raptors locker-room midway through the quarter after running into Drummond on a pick play. The initial assessment was lower back tightness.

Monroe got the call again with 5 1/2 minutes remaining in the third when Valanciunas picked up his fourth foul. But it was Toronto guard Fred VanVleet who drew the spotlight, drawing oohs for dribbling past Reggie Jackson like the Piston was a pylon.

The 61-year-old Casey led Toronto to three consecutive 50-win campaigns and four Atlantic Division titles in five seasons.

But after failing to get past the Cavaliers again in the playoffs, Casey was fired May 11 -- two days after being honoured with the Michael H. Goldberg Coach of the Year Award by the National Basketball Coaches Association. He went on to win NBA Coach of the Year Award as voted on by the media, in June.

Casey, who was 320-238 in seven seasons in Toronto was hired by the Pistons one month after being let go by the Raptors following a franchise-high 59-win season.

Casey was nostalgic about his team in Toronto, still referring to the Raptors as "we."

"This place was special for seven years. I'd be lying if I didn't say that," he said prior to the game. "Special from where we started, from where we are now. The way it ended wasn't special. But again that's the NBA.

"If we had lost 20 games, 40 games, it would have been probably understandable ... I understand it because it is the NBA but you never understand why. Because you did win and you won at a high level."

Both teams were coming off losses -- Detroit to Charlotte and Toronto to New Orleans.

The Raptors were also missing Norman Powell (shoulder) and C.J. Miles (adductor strain).