The Toronto Raptors' record run at home came to an end Sunday night.

And in the minutes after the Raptors' 113-107 loss to the Houston Rockets — Toronto's first defeat at the Air Canada Centre in 13 games — the players talked about a lesson learned.

"Defence" was the word of the night as the Raptors coughed up an 18-point lead and allowed the Rockets to score 36 points in the fourth quarter.

"We've just got to get better defensively, and continue to grow defensively. It's a broken record for all of us," Kyle Lowry said. "That's where we have to get better, and I think everyone in the lockerroom and coaching staff would agree. Defence is the priority."

James Harden had 20 of his 40 points in the fourth quarter, and was almost as lethal creating plays, doling out 14 assists.

Luis Scola topped Toronto (41-20) with 21 points, while DeMar DeRozan had 19 points. Lowry finished with 17 and nine assists, and Jonas Valanciunas chipped in with 12 points and 10 boards.

Dwight Howard had 21 points and 11 rebounds for Houston (31-32) before fouling out with 2:08 to play.

DeRozan had an uncharacteristically quiet night. He didn't attempt a shot until nine-and-a-half minutes into the game, and didn't make a shot until about three minutes before halftime. He and fellow all-star Lowry took just 20 shots between them.

"They were trying to get the ball out of our hands, but we can't defer to that, we've got to be more aggressive, and understand what teams are going to do, especially when they're doing it to both of us," DeRozan said. "Usually it'll be one or the other and we'll try to play off it. Tonight they were trying to do it to both of us. But it's a learning experience."

The Raptors led by double digits for much of the night, but saw their 18-point first-half lead disappear by midway through the fourth quarter. Back-to-back three-pointers from Trevor Ariza gave the Rockets their first lead since the first quarter with 4:43 to play.

Harden, the league's No. 2 scorer, drained a three — and shot a sinister look at the Raptors' bench — to put the Rockets up by two, then made two free throws on the next trip down the floor to put Houston up by four points with 1:18 to play.

Little went Toronto's way down the stretch, as DeRozan was called for a flagrant foul for plowing over Patrick Beverley with a minute to play. Then Clint Capela's basket made it a seven-point Rockets lead, and it was game over for the Raptors, much to the dismay of the capacity crowd of 19,800 fans, who headed for the exits.

"That's been our Achilles heel all year," coach Dwane Casey said, on giving up a substantial lead. "I've said that millions of times. We've luckily won some of these games, but then I've always said it's going to come back to bite us. We've got to keep the same intensity when we get leads, the same quality of possessions offensively.

"We learn from it, we've been preaching it, so I guess it's a situation now where you get your butt kicked, and it kicks in."