MIAMI (AP) When the playoffs open next weekend, the Toronto Raptors will be at home.
And, almost certainly, so will the Miami Heat.
Lou Williams scored 29 points, DeMar DeRozan added 24 and the Raptors put the Heat on the brink of playoff elimination with a 107-104 victory Saturday night.
Greivis Vasquez and Kyle Lowry each scored 12 points and Patrick Patterson had 11 for the Raptors. They clinched home-court advantage in the first round of the playoffs and dealt an absolutely crippling blow to Miami's postseason hopes.
''For our organization, where we are, the process we're going through, I think it's important,'' Raptors coach Dwane Casey said about wrapping up home-court. ''You can't take anything for granted. ... These guys fought for it, scratched for it. They earned it.''
Dwyane Wade scored 30 points for the Heat, who can only get to 37 wins - the number that Brooklyn and Boston are already at, putting them in the No. 7 and No. 8 spots in the Eastern Conference race. Goran Dragic scored 22 points for Miami and Hassan Whiteside finished with 16 points and 18 rebounds.
But Whiteside also missed 12 free throws, going 4 for 16, and as a team the Heat went 24 of 44 from the line.
''Nobody needs to feel sorry for any of us,'' Heat coach Erik Spoelstra said. ''This is what you sign up for in this business. You don't know what's going to happen ... and this year has had its challenges for all of us. But we've been grinding and fighting.''
The fight might be gone now. A season that started essentially in July when LeBron James left, then saw Josh McRoberts succumb to injury and Chris Bosh to illness, has now all but slipped away.
''We have nothing to be ashamed of,'' Wade said.
Williams hit a 3-pointer with 31.2 seconds left to put the Raptors up by five, and that just about sealed the game and Miami's playoff fate. The Heat must win their last two games, and get a ton of help to reach the postseason for the seventh straight year.
It was Toronto's first road win over the Heat since Nov. 19, 2008, ending a 10-game slide on Miami's home floor. The win was Toronto's 48th of the season and 22nd on the road, both tying franchise records.
''This one especially feels good, clinching home-court,'' said Williams, who had 17 in the second quarter alone.
Wade had 11 in the third, including one stretch where he got a rebound while down on the floor and ended up scoring seconds later, followed by another layup while getting knocked down again.
But in the end, there just wasn't enough.
''Played good enough to win,'' Wade said. ''Just didn't.''
Raptors: Williams had never scored 17 in a first, second or third quarter. He'd scored at least that many in a fourth quarter five times. ... Tyler Hansbrough had his nose bloodied midway through the first quarter, taking an inadvertent hit from Wade on a drive near the basket. He stayed in the game. ... Before last season, the Raptors had never finished with a winning road record. They've now done it in each of the past two seasons.
Heat: Dragic had 12 points in the first quarter, matching his best opening quarter since coming to the Heat. ... Whiteside had 12 points and 11 rebounds by halftime, the third time this season he's had a double-double before intermission. ... With his first assist, the 1,981st of his Heat career, Mario Chalmers broke a tie with LeBron James for third on Miami's list in that department.
The Raptors were without Amir Johnson (sprained right ankle) for a fourth straight game, and coach Dwane Casey said he's hopeful of getting him back for one game before the playoffs start next weekend. Miami had Henry Walker (elbow) available, but he did not play.
Whiteside became the third player this season to miss at least 12 free throws in a game. DeAndre Jordan of the Los Angeles Clippers has done it four times, and Houston's Josh Smith missed 14 in Friday's loss to San Antonio.
Raptors: At Boston on Tuesday night.
Heat: Host Orlando on Monday night.