DALLAS — Vince Carter sank a double-pump three-pointer at the buzzer to give the Dallas Mavericks a 109-108 victory in Game 3 and a first-round series lead over the top-seeded San Antonio Spurs.

With 1.7 seconds left, Carter took an inbound pass from Jose Calderon in the left corner. After a quick pump fake got Manu Ginobili in the air — moments after the Argentine guard had given the Spurs the lead — Carter released the ball just in time, as confirmed by review.

Carter knew right away the exact date of the last time he had a buzzer-beating try in a playoff game — 13 years ago.

“May 20th, Game 7,” said Carter, referring to an 88-87 loss to Philadelphia in the 2001 Eastern Conference finals when he was with Toronto.

“I don’t mind taking the game-winning shot,” said Carter, who otherwise had a rough day before finishing with 11 points. “I don’t mind missing them, and dealing with it. So I think having that mentality helps me.”

Monta Ellis finished with career playoff-high 29 points, including 12 in the fourth quarter that helped the eighth-seeded Mavericks keep the home-court advantage they had earned with a Game 2 victory in San Antonio. Game 4 is scheduled for Monday night in Dallas.

Tim Duncan led the Spurs with 22 points.

Ginobili, who scored 12 points, dribbled out most of the last 24 seconds before going around Duncan and scoring over Samuel Dalembert for a 108-106 lead. His go-ahead shot spun around the rim and almost came out before falling in.

“You never think it’s over, especially in here,” Ginobili said. “We’ve got experience on that. As long as you don’t see ‘zero zero’ over there, it’s not over.”

The Mavericks won despite the Spurs holding Dirk Nowitzki under 20 points in a third consecutive playoff game for the first time since they did it to him in his first postseason in 2001. Nowitzki finished with 18 on Saturday.

Dallas still had a chance in the closing seconds because of Ellis, who tied the score twice in the final 1:10, first with a three-point play on a floater after he was fouled by Boris Diaw.

After Diaw put the Spurs back in front with a baseline jumper, Ellis hit another high floater in the lane with 24.9 seconds left, setting up Ginobili’s dramatic shot.

Tony Parker had 19 points, but only two after halftime. Tiago Splitter had 14 points and 13 rebounds, and Kawhi Leonard added 17 points.

Dalembert did most of his damage in the first half but still made his presence felt after halftime. He finished 13 points, 10 rebounds and four blocks, and made two free throws for a 104-all tie after rebounding a Nowitzki miss.

“When his activity is like this, he’s rebounding it and he’s got a presence at the rim, it makes such a big difference for us,” Dallas coach Rick Carlisle said.