Kyle Lowry scored 24 points, Pascal Siakam added 23 points and 13 rebounds, and the Toronto Raptors defeated the visiting Sacramento Kings 124-120 Wednesday night.

Serge Ibaka scored 21 points, OG Anunoby contributed a season-best 18 points, and Marc Gasol and Fred VanVleet each had 12 for the Raptors.

Harrison Barnes led Sacramento with 26 points. Bogdan Bogdanovic added 22 points off the bench, and Buddy Hield scored 21. De’Aaron Fox had 17, and Cory Joseph scored 10 for the Kings, who had won their two previous games after an 0-5 start to the season.

The Kings tied a franchise record with 20 made 3-pointers.

The Raptors led by as many as 15 points in the second quarter and were ahead 95-88 going into the fourth. The Kings cut that to three points early in the fourth but did not get closer despite continuing to threaten. Anunoby missed two free throws with 10.4 seconds remaining and the Raptors leading by four points, and the Kings missed two shots to end the game.

The Raptors shot a scorching 77.8 percent (14 of 18) from the field to lead 36-23 after the first quarter.

Toronto led by as many as 15 points early in the second quarter before Fox trimmed it to five with a floater with 5:35 until the break.

The Raptors worked the lead up to 12 before Bogdanovic hit a 3-pointer to cut the margin to four points with 3:05 left. Toronto led 66-58 at halftime.

The Kings trimmed the deficit to four early in the third quarter on a floating jumper by Richaun Holmes. The Raptors pulled ahead by 11 points on Lowry’s 3-point shot with 5:08 remaining in the third quarter. Ibaka’s dunk two minutes later put the Raptors ahead by 14 points.

Bogdanovic opened the fourth quarter with a 3-pointer. Lowry was called for a foul 34 seconds later, and his complaints earned a technical foul that Bogdanovic converted, trimming the lead to three points.

The Raptors were up by seven after Ibaka’s dunk with 6:04 to play. Barnes made a 3-pointer to pull Sacramento within four points with 1:11 remaining.