Carmelo Anthony and LeBron James were nearly matching each other miss for miss. But with the game on the line, James connected for some big buckets and Anthony misfired again.

Anthony had a chance to tie it, but his three-pointer with 1.5 seconds left rattled and rimmed out, and the Knicks lost their sixth straight game, 90-87, to the Cavaliers Thursday night at Madison Square Garden. They're 4-16, the worst record after 20 games in franchise history.

Anthony finished 4-for-19 with nine points. In the fourth, he was scoreless, missing all four of his shots. In Tuesday's loss to the Nets, he missed two three-pointers with a chance to tie at the finish and was 1-for-9 in the fourth quarter.

Tim Hardaway Jr. led the Knicks with 20 points. Amar'e Stoudemire added 18.

Kyrie Irving torched the Knicks for 37 points, including a layup with 10 seconds left for the final points. James was 7-for-17 and scored 19. He gave the Cavaliers (10-7) the lead for good with a three-pointer with 3:54 left.

The Knicks led by 11 in the first half and seven in the fourth but couldn't close out the game.

It was a wild ending that featured a controversial eight-second violation on the Knicks with 1:11 left and Cleveland up 88-87. But Irving missed and Anthony rebounded it. Derek Fisher was calling for a timeout, but no one heard him.

Fisher didn't get the timeout he wanted in the closing seconds Tuesday. He made his way out to halfcourt and was waving his arms for time until it was finally granted with 41 seconds to go.

Out of the timeout, instead of Anthony or Stoudemire getting the ball, Shane Larkin took the shot and missed a runner. Anthony couldn't convert on a tip-in with 32 seconds remaining.

The Cavaliers called timeout and fittingly got the ball to Irving, who had been giving the Knicks fits all night. He put the final nail in the coffin, driving past Iman Shumpert and hitting a floater high off the backboard to give the Cavs the three-point lead with 10 seconds left.

The Knicks rode Stoudemire early in the fourth, and he delivered with a huge dunk over Anderson Varejao and a tough layup inside that made it 79-72 with 8:57 left.

But the Knicks' lead was gone five minutes later, after James drilled a three with 3:54 left to make it 86-85 Cavaliers. On the ensuing trip, Irving stole the ball from Jose Calderon and fed James for a breakaway dunk with 3:25 to go.

After Stoudemire scored, the Knicks had several chances to regain the lead. But Stoudemire and James missed inside, and then Anthony was called for a travel as he went in for a layup. James missed on the other end, but Stoudemire's short hook rimmed out with 1:40 left.

The Knicks' win in Cleveland on Oct. 30 easily was their best of the season, and not a game that Cavaliers coach David Blatt wants to relive.

"When I feel like being particularly masochistic, I go back and look at that game,'' Blatt said before Thursday night's game. "Given my experience, I try to avoid that whenever I can. You look at certain elements of a game. To sit and watch the whole game is almost too painful.''

The Knicks were looking for a repeat performance, and got off to a much better start than they had in their previous three games, when they trailed by double figures in the first half of all three. The Knicks reversed that trend against the Cavaliers, with the bench providing a spark.

Hardaway was 2-for-12 with four points in the previous two games, but he gave the Knicks a lift. He scored 11 points during a 13-0 run that gave the Knicks a 37-27 lead with 7:54 left in the half. Hardaway buried three three-pointers in the run and scored 16 points in the half.

The Knicks' reserves outscored the starters 29-24 in the opening half, helping the Knicks to a 53-50 lead at the break.