TORONTO (AP) - After 17 consecutive wins, Houston star James Harden wasn't going to let one little loss spoil his outlook.
Kyle Lowry scored 30 points, DeMar DeRozan had 23 and the Toronto Raptors beat Houston 108-105 on Friday night, snapping the Rockets' 17-game winning streak.
Harden scored 40 points but the Rockets lost for the first time since Jan. 26 at New Orleans.
''I don't even feel like we lost,'' Harden said. ''Same swagger. Nothing changed. It's one game.''
Jonas Valanciunas had 14 points and 10 rebounds as the Raptors won their seventh straight in a matchup between the respective conference leaders.
''My hat is off to our guys,'' Raptors coach Dwane Casey said. ''They did everything we asked them to do.''
The Rockets shot 9 for 27 from 3-point range, matching their fewest made 3-pointers of the season.
''That was our game plan, to keep them inside the 3,'' Lowry said. ''We tried to take away one of their strengths.''
Houston shot 1 for 9 from 3-point range in the first half.
''Early, we didn't make our open 3s,'' Rockets coach Mike D'Antoni said. ''We didn't have a whole lot of them, but we didn't make them.''
Clint Capela had 13 points and 13 rebounds for the Rockets. Chris Paul and Eric Gordon each scored 14 points, and Trevor Ariza had 13 as Houston's road winning streak ended at 10.
''They've been playing exceptionally well of late,'' DeRozan said, ''so for us to come in here and protect home court is big.''
Toronto improved to 28-5 at home, the best record in the NBA.
Houston tied it at 102 on Harden's 3 with 2:10 remaining, but DeRozan restored Toronto's lead with a jump shot with 1:49 left.
Paul missed a go-ahead 3 with 14 seconds to play, then fouled Lowry in the scramble for the rebound. Lowry made both, giving the Raptors a 106-102 lead with 10 seconds to go.
Gordon answered with a 3, making it a one-point game. Houston fouled Valanciunas, who made a pair to put Toronto up by 3 with 5.4 seconds to go.
Harden got the final shot but his deep 3 from the edge of the center court circle went short.
''We had our chance to win and we just didn't get it done,'' D'Antoni said.
The Rockets missed eight of their first 10 field goal attempts and shot 6 for 21 in the first, missing all five 3-point attempts. It was Houston's lowest-scoring first quarter of the season and just the second time they've failed to score at least 20 points in the first.
Harden scored nine points in the second but the Rockets continued to struggle from long range, making one of four 3-point shots. DeRozan had seven points for the Raptors, who led 58-43 at halftime.
Houston's only lower-scoring first half this season was a 39-point effort in a Feb. 26 win at Utah.
''We didn't match their intensity until late,'' Paul said. ''Our defense wasn't aggressive enough early.''
The Rockets were 1 for 12 from 3-point range before Harden drained back-to-back shots with 2:48 left in the third. Harden scored 14 in the third, overcoming nine points from Lowry, as Houston cut the deficit to 83-75 after three.
Rockets: F Ryan Anderson (left hip) missed his sixth straight game. ... Joe Johnson returned after missing the previous two games because of an illness. ... The Rockets had 62 points in the paint.
Raptors: Forward OG Anunoby (sprained right ankle) missed his fourth straight game. ... G Delon Wright (sprained right big toe) was unavailable after leaving Wednesday's win at Detroit. Wright initially suffered the injury in Tuesday's home win over Atlanta.
BEFORE THE BEARD
DeRozan and Harden were each born in Los Angeles a few weeks apart in August 1989, and grew up playing with and against one another.
''I knew him when he didn't have a lick of hair on his face,'' DeRozan said at shootaround.
BREAK OUT THE BROOMS
Toronto swept Houston for the first time since 2005-06. The Raptors beat the Rockets 129-113 in November, Houston's biggest home loss of the season. Toronto has now swept its season series against 10 opponents.
Rockets: Visit Dallas on Sunday. Houston has won seven straight in the series, its third-longest streak all-time.
Raptors: Visit New York on Sunday.