Updated

Dirk Nowitzki scored 22 points, Devin Harris hit the go-ahead shot in the final minute and the Dallas Mavericks rallied in the fourth quarter after blowing a 30-point lead, beating the Portland Trail Blazers 103-98 Friday night.

LaMarcus Aldridge finished with 30 for Portland, including 18 in the third quarter when the Blazers went in front for the first time at 69-67 after trailing 44-14 early in the second quarter.

The Mavericks nearly tied the franchise record for their biggest blown lead. They lost at the Los Angeles Lakers 105-103 on Dec. 6, 2002, after leading 66-36 early in the third quarter.

The score was tied 98-all when Aldridge missed a shot from the lane and Harris won the scramble for the rebound. He dribbled the length of the floor and hit a leaning shot on the baseline and was fouled by Damian Lillard.

After the free throw put Dallas up by three, Aldridge's pass went over Lillard's head out of bounds.

Monta Ellis missed two free throws, but Vince Carter snuck in for the offensive rebound and was fouled. Carter made both free throws, and Ellis had a steal to seal a wild win that snapped the Mavericks' season-high three-game losing streak.

Dallas took its first 30-point lead on Brandan Wright's alley-oop dunk from Ellis early in the second quarter, one of many easy breakaway baskets early.

Thomas Robinson had six points on a 12-1 run that started Portland's comeback, getting the Blazers within 19. That was the Dallas lead at halftime when Aldridge took over, scoring six straight early in the third and another six straight later.

The Blazers wiped out the last of Dallas' lead on a 3-pointer by Wesley Matthews to knot it 67-all with 4:02 left in the third. The Blazers went ahead for the first time at 69-67 on a putback by Aldridge, who had 17 rebounds.

The lead changed hands three more times late in the third, setting up a back-and-forth battle in the fourth.

Portland pushed out to an 85-78 lead on another 3 from Matthews, who had 26 points, and a jumper from Mo Williams, but Harris hit a 3-pointer to finish an 8-0 Dallas run for a 90-89 lead.

The Blazers went back up 98-92 on an alley-oop dunk by Aldridge, but Dallas pulled even when Sam Dalembert stole the ball from Lillard and tossed to Ellis for a breakaway layup.

Jose Calderon had 19 for Dallas, including 15 in the first quarter. Ellis had 17 points, eight rebounds and seven assists. Nowitzki had six assists and five rebounds. Harris finished with 12 points.

NOTES: Robinson returned after missing four games with a left knee injury. He fouled out with 7:52 remaining. ... Ellis made his 500th career start. ... The Mavericks shot 53 percent in their 115-110 loss to Denver on Wednesday. It was their best shooting percentage in a loss this season. ... The Blazers had season lows for points in a quarter (10) and the first half (38). The previous low for a first half was 41 in a 90-89 win over Phoenix.