Updated

Vince Carter led a 19-0 surge in the third quarter and finished with 20 points as the Orlando Magic beat Boston 96-89 on Sunday, moving ahead of the Celtics and into second place in the Eastern Conference.

Carter scored nine points during a rally that began after Rajon Rondo's 3-pointer gave the Celtics a 60-51 lead with 7:17 left in the third quarter - Boston's fourth and final field goal of the period.

The Magic turned a 51-40 halftime deficit into a 76-62 lead after the third and stayed in front by at least five points the rest of the way.

Dwight Howard had 16 points and 13 rebounds for Orlando.

Rondo scored 17 points and Ray Allen added 13 for the Celtics.

The Celtics made a late run with seven straight points that cut the lead to 94-89. But Rashard Lewis just beat the 24-second buzzer with a short driving shot that made it 96-89 with 18 seconds to go.

The Magic (34-17) rebounded from a loss Friday night to Washington in which they blew a 21-point lead and moved one game ahead of the Celtics (32-17).

Boston lost despite getting two important players back. Paul Pierce, their leading scorer, returned after missing two games with a strain on the top of his left foot and scored 13 points. Key substitute Marquis Daniels sat out the previous 29 games following surgery for a torn ligament in his left thumb and finished with eight points.

Carter started the 19-0 spurt with a 3-pointer. Howard then picked up his fourth foul with 5:58 left in the quarter but remained in the game, and Carter followed with a three-point play. Then the Magic, the most prolific 3-point shooting team in the NBA, made three straight - by Lewis, Carter and Lewis again - for a 66-60 lead. Howard then dunked an alley-oop pass from Matt Barnes and Jameer Nelson followed with a driving layup.

Tony Allen finally scored for the Celtics on two free throws, cutting Orlando's lead to 70-62 with 1:33 left in the third. But the Magic got the final six points of the quarter on two free throws by Lewis and a layup and two free throws by Jason Williams - giving them 25 of the last 27 points in the period.

The Celtics led 34-29 when Howard picked up his third foul and left the game with 8:26 left in the second quarter. The Magic tied it at 34 on a 3-pointer by Carter and a layup by Williams.

Then Boston went on a 12-2 run, starting with Rasheed Wallace's basket from the left corner and ending with Pierce's 3-pointer off a behind-the-back pass from Rondo. That gave the Celtics a 46-36 lead with 1:59 left in the half and they led 51-40 at intermission.

Kevin Garnett, scoreless in the first half, scored Boston's first three baskets in the third quarter to maintain the 11-point lead at 57-46. But Orlando went on a 14-3 run, tying the game at 60 on a 3-pointer by Lewis with 4:36 left in the period.

NOTES: Garnett had nine rebounds, moving into 20th place all-time with 11,960. He passed Dennis Rodman, who had 11,954. ... Boston is 1-7 combined against Orlando and Atlanta, two of the top four teams in the East. ... Orlando improved to 15-12 on the road while Boston fell to 15-9 at home.