LeBron James tipped in a missed shot as time expired to lift the Los Angeles Lakers to a 120-119 victory over the Indiana Pacers on Wednesday night.

James, who had struggled offensively for most of the game, finished with 13 points, 13 rebounds, and seven assists. His game-winning basket capped a 10-point fourth quarter, helping the Lakers snap a three-game losing streak.

Luka Doncic led Los Angeles with 34 points, adding seven rebounds and seven assists while hitting six three-pointers.

Austin Reaves contributed 24 points, and the Lakers (44-28) moved into a tie with Memphis for the fourth seed in the Western Conference.

Indiana (42-30) saw its five-game winning streak come to an end despite a strong performance from Bennedict Mathurin, who led the team with 23 points. Tyrese Haliburton dished out a season-high 18 assists and scored 16 points, including a go-ahead layup with 42.2 seconds left.

The Lakers held a six-point lead with under two minutes remaining, but the Pacers surged ahead behind a 7-0 run capped by Haliburton’s three-point play. Doncic missed a potential game-winner, but James was in the right place at the right time to tip in the decisive basket.

Los Angeles shot 51.9% from the field and made 17 three-pointers, while Indiana connected on 50.6% of its shots and hit 15 triples. The Lakers controlled most of the game after an 18-0 run in the first half, but Indiana clawed back to set up the dramatic finish.

With the win, Los Angeles maintains its push for home-court advantage in the first round of the playoffs. Indiana, meanwhile, remains in the mix for a top-four seed in the East despite the loss.