“That was pretty cool right there,” the nine-year NBA veteran said after the game. “Especially since I was mad at myself for not making my shots the whole game.”

Ray McCallum missed a 21-foot jumper as time ran out for the Kings and Portland’s Robin Lopez grabbed the rebound and held it tight for the victory.

LaMarcus Aldridge had 22 points to lead the Blazers, who have won six of their past seven games.

“It was an exciting way to win a game,” Blazers coach Terry Stotts said. “Dorell picked a good time to make his shot.”

Portland, which has missed the playoffs for the past two seasons, clinched a postseason berth with a 100-94 victory over New Orleans on Sunday. The Blazers were fifth in the Western Conference with three games left.

DeMarcus Cousins had 30 points and 12 rebounds for the Kings, who were without injured guard Rudy Gay. Sacramento has lost four straight and sit near the bottom of the conference in front of the Los Angeles Lakers and Utah.

Sacramento trailed by as many as 15 points late in the first half, but the Kings pressured the Blazers in the second and tied it at 84 on McCallum’s 3-pointer with 8:17 left in the game.

Damian Lillard’s 3-pointer put Portland up 91-86, but Cousins’ layup tied it again at 93 with 3:12 left.

Aldridge dunked, but Travis Outlaw’s jumper tied it again before Cousins scored to make it 97-95 for the Kings with 1:31 left. It was Sacramento’s first lead of the game.

Lopez made two free throws for the Blazers to tie it at 97 with 42.3 seconds to go. Cousins made a pair of free throws to give the Kings back a 99-97 lead with 14.8 seconds left before Wright made the 3 for the win.

After the game, Wright’s Blazers teammates nicknamed him “Little Robert Horry.”

“We didn’t get a great shot, didn’t get great execution on that last play, but a great opportunity for Ray to make a play,” Kings coach Michael Malone said. “But he came up a little bit short.”

Lillard had 19 points and 10 rebounds.

“We made it a lot tougher than it should have been,” Lillard said.

Gay also missed Tuesday night’s 107-92 loss at Oklahoma City because of a lower back strain. Guard Isaiah Thomas missed his ninth straight game because of a right quad injury.

Former Blazer Travis Outlaw got his fourth start of the season for the Kings.

The Kings appeared worn out after playing the night before and Portland pulled away in the second quarter with a 10-0 run that made it 48-35. The Blazers extended the lead to as many as 15 points and went into the break with a 56-46 lead.

But the Kings closed the gap to 68-65 on Jason Thompson’s dunk midway through the third quarter. Cousins’ hook shot got Sacramento within 70-67. But Portland responded with a 9-0 run capped by Thomas Robinson’s jumper to pull back ahead 79-67 before the quarter was over.

Sacramento had a nine-point run to narrow it to 79-77 with 10:45 left. Lillard answered with a 3-pointer for the Blazers.

“We’re playing against great teams that are playing for something and it’s not like they aren’t giving it their all,” McCallum said. “So to know that we can compete with some of these top teams should give us a lot of confidence.”

Notes: The Portland Trail Blazers - as well as owner Paul Allen - are appearing on Thursday night’s episode of Portlandia on the IFC channel. All-Star forward Aldridge previously appeared on the show as Penny Marshall’s boyfriend. … Former Oregon State guard Jared Cunningham was playing the final game of a 10-day contract with the Kings, although Sacramento could keep him until the end of the regular season. … It was Blazers rookie Alan Crabbe’s birthday.