NEW ORLEANS (AP) — Shai Gilgeous-Alexander highlighted his 32-point night with a go-ahead baseline jumper and four clutch free throws in the final 29 seconds, and the Oklahoma City Thunder beat the New Orleans Pelicans 123-118 on Wednesday night to remain alive in the Western Conference play-in tournament.

Josh Giddey had 31 points, 10 assists and nine rebounds for Oklahoma City, the only Western Conference team still playing with a losing record.

“We’ve been battle tested. We’ve played in a lot of close games all year, for the past couple of years,” Gilgeous-Alexander said. “Even when the season wasn’t going our way, we played in a lot of close games and we have good habits and we know what gets it done down the stretch.”

The loss eliminated the ninth-seeded Pelicans, while 10th seed Oklahoma City advanced to play at Minnesota on Friday night for the right to enter the NBA playoffs as an eighth seed and meet No. 1 Denver.

Brandon Ingram scored 20 of his 30 points in the second half, including a 3-pointer with 4.3 seconds left to give the Pelicans a slim chance to come back.

But after Gilgeous-Alexander hit two free throws, Herbert Jones threw away an inbound pass, virtually sealing New Orleans’ fate.

Lu Dort scored 27 for the Thunder, including a pair of free throws with 6.2 seconds left.

Jonas Valanciunas had 16 points and 18 rebounds for New Orleans, but checked out with 4:26 after apparently hurting his right foot. He returned only briefly in the final minute.

Trey Murphy III scored 21 points, Jones had 20 and CJ McCollum 14 for the Pelicans, who a season ago went 2-0 in play-in games as a ninth seed to advance to the first round of the playoffs.

This time New Orleans, which was at the top of the Western Conference standings in December, was left to wonder what might have been had Zion Williamson not gone out for the rest of the season with a hamstring injury on Jan. 2.

New Orleans led 69-62 early in the third quarter before the Thunder surged in front with a 13-2 run capped by Gilgeous-Alexander’s driving layup as he was fouled.

Gilgeous-Alexander scored 17 in the period and Giddey added 12, including his third 3 of the game to give Oklahoma City a 95-85 lead.

But New Orleans quickly tightened the game back up early in the fourth with a 7-0 run that included reserve guard Josh Richardson’s 3 that pulled the Pelicans to 98-96.

The Pelicans went back in front when Richardson’s steal and breakaway dunk made it 101-100, but as the Thunder came back up the court, Richardson was called for a foul after knocking Giddey to the floor near midcourt. Giddey angrily came to his feet and started angrily toward Richardson. Teammates held both at bay while officials called for a video review and determined that Richardson had committed a flagrant foul.

Giddey made one of two free throws to tie it and set the stage for an intense finish.

Dort, who averaged 13.7 points during the regular season, scored 14 in the first quarter. But the Pelicans surged in front late in the first half when Murphy hit a pair of 3s to help New Orleans go into halftime with a 63-57 lead.

Ingram appeared to turn his left ankle when he stepped on a foot late in the second quarter. He did not check out of the game, however, and played most of the second half.