By the Associated Press

Los Angeles Lakers forward LeBron James celebrates after making a 3-point shot against the Sacramento Kings during the second half of an NBA basketball game in Los Angeles, Friday, Nov. 15, 2019. (AP Photo/Alex Gallardo)

LOS ANGELES — LeBron James hit two free throws with 5.5 seconds to play, and Anthony Davis blocked Harrison Barnes’ driving shot at the buzzer with both hands in the Los Angeles Lakers’ 10th win in 11 games, 99-97 over former coach Luke Walton and the Sacramento Kings on Friday night.

James had 29 points and 11 assists, and Kentavious Caldwell-Pope scored 12 of his 16 points in the fourth quarter of the Western Conference-leading Lakers’ third straight win.

The Lakers led 95-90 with three minutes left after Caldwell-Pope’s third 3-pointer, but Bogdan Bogdanovic scored five straight points to tie it. James hit a layup with 1:50 left, but Bogdanovic eventually replied with a tying layup with 22 seconds to play.

Barnes fouled James on the perimeter, and the shaky free-throw shooter smoothly hit both of his shots. Barnes then tried to drive for a tying shot, but Davis got his fourth block of the night in two-handed style.

In his first game back from a one-game rest of his sore right shoulder, Davis scored 17 points in his second lowest-scoring performance for the Lakers. James did most of the heavy lifting to hold off a spirited effort from the Kings, who lost for only the second time in six games since their 0-5 start.

Buddy Hield had 21 points and eight rebounds, and Bogdanovic added 18 points for the Kings in the L.A. return of Walton, who was fired by the Lakers last April after presiding over three consecutive losing seasons.

Los Angeles Lakers forward Anthony Davis, right, blocks a shot by Sacramento Kings forward Harrison Barnes in the last second of an NBA basketball game in Los Angeles, Friday, Nov. 15, 2019. The Lakers won 99-97. (AP Photo/Alex Gallardo)

Sacramento nearly pulled off the upset despite playing without De’Aaron Fox, who missed his second straight game with a sprained left ankle, and Trevor Ariza, who sat out with a sore groin.

Richaun Holmes scored nine of his 17 points in the fourth quarter.

Sacramento led by 13 in the first half while hitting 10 3-pointers, but the Lakers scored 14 consecutive points in the second quarter to pull even. James posted the highlight of the half with a drive and a high-flying dunk right on top of Nemanja Bjelica, who had regrettably tried to draw a charge.

Alex Caruso scored a season-high 10 points for the Lakers while playing extra minutes in place of injured starter Avery Bradley.

Walton’s pregame introduction was greeted with an indistinguishable mix of boos and cheers of “Luuuuuke” for the coach who took over the Lakers in 2016.

The former Lakers forward’s teams posted three straight improved records, but his performance wasn’t rated highly by former Lakers boss Magic Johnson or by general manager Rob Pelinka, who fired Walton just five days after Magic’s surprise resignation last April.

“It’s always a special place when you come into this building,” Walton said. “A lot of great memories in L.A. It was a great opportunity playing here and coaching here.”