NEW YORK (AP) — Julius Randle had 36 points and 13 rebounds, and his eighth 3-pointer snapped a tie with 2:07 left as the New York Knicks beat the Cleveland Cavaliers 105-103 on Tuesday night.

Donovan Mitchell had 24 points, eight assists and eight rebounds in his return from a three-game absence with a left groin strain. But he had was stopped on his last three attempts at the rim and was slow to get up after falling to the ground in an effort to save the Cavaliers’ final possession, saying afterward his legs cramped.

RJ Barrett added 16 points and Jalen Brunson had 14 for the Knicks, who snapped a four-game losing streak.

Jarrett Allen had 24 points and 12 rebounds for Cleveland, while Darius Garland added 22 points and six assists.

The Knicks were ahead by 11 with under eight minutes remaining before Mitchell made a 3-pointer, stole the ball from Randle and fed Isaac Okoro for a three-point play, and then made another 3 for nine straight Cleveland points in barely a minute to trim it to 93-91.

Evan Mobley’s basket tied it with 2 1/2 minutes to play before Randle answered with his 3 on the other end. Cleveland had two chances to tie or cut it to one, but Mitchell was blocked first by Barrett and then by Isaiah Hartenstein on the next possession.

Brunson then made two free throws for a five-point lead but Garland had a three-point play that trimmed it to 105-103. The Cavs got the ball back after a shot-clock violation and Mitchell drove into the lane but was stopped again by Hartenstein. Mitchell went to the ground and the Cavs batted the ball back out to Evan Mobley, whose jumper missed.

Cavs coach J.B. Bickerstaff motioned to two referees afterward that he was trying to get a timeout during that possession that they missed.

Randle had five 3-pointers and 17 points in the first 9 1/2 minutes and the Knicks led 34-27 after one quarter. But he took just one shot in the second, when Allen went 5 for 5 for 10 points as Cleveland cut it to 53-51 at the half.

TIP-INS

Cavaliers: Mobley had 12 points after scoring a career-high 38 against Milwaukee on Saturday. … The Cavs dropped both games at Madison Square Garden this season, where they have won 12 of their last 16.

Knicks: It was the ninth anniversary of Carmelo Anthony’s 62-point performance against Charlotte that set the Knicks’ and current Madison Square Garden single-game records. … Brunson will have his No. 1 jersey retired at Villanova, where he won two NCAA titles, at halftime of its Feb. 8 game against DePaul.

UP NEXT

Cavaliers: At Houston on Thursday.

Knicks: At Boston on Thursday.