It took nearly 13 years, but Vince Carter has finally been vindicated.

With Game 3 on the line Saturday afternoon at American Airlines Center, Carter rose up from the left corner and sank a 3-pointer at the buzzer to lift the Dallas Mavericks to a 109-108 victory over the San Antonio Spurs.

Carter’s dramatic shot stunned the No. 1-seeded Spurs and gave the No. 8-seeded Mavericks a 2-1 lead in this best-of-seven first-round playoff series.

Game 4 is set for 8:30 p.m. Monday in Dallas.

Once Carter’s shot went through the net, the 15-year veteran was mobbed by his teammates and coaches, and the 20,636 fans in attendance roared with their approval.

Approval that came after — during the previous timeout — coach Rick Carlisle steadfastly assured Carter that he was going to make the game-winning shot.

“He said, ‘Hey, you’re going to get the ball, you’re going to knock it down,’ ” Carter said of Carlisle. “I said, ‘OK. No problem.’ ”

Coming out of the huddle leading up to his buzzer-beating 3-pointer, Carter started reminiscing about May 20, 2001, when he was playing in Game 7 of the Eastern Conference semifinals for the Toronto Raptors in Philadelphia against the 76ers. Carter flew from Philadelphia to Chapel Hill, N.C., to receive his college diploma that morning, and later that evening he missed the would-be winning 19-foot jumper at the buzzer. The Raptors lost 88-87.

“To be honest with you, I thought about that as we were coming out of the timeout,” Carter said. “I said if I get the ball, let’s make this one, so in my mind I was ready for it.

“I had already made the shot before the play happened if I got the ball, so I’m just glad it worked out.”

So, too, are the Mavericks, who led 59-54 at halftime and had an all-out struggle on their hands against the Spurs, who supplied their own magic down the stretch.

Manu Ginobili, who guarded Carter on the final play, shook free from a pick-and-roll and flipped in a layup over Samuel Dalembert to give the Spurs a 108-106 lead with just 1.7 seconds to go. It appeared as though the nifty play by Ginobili would doom the Mavericks.

But Carter, who waited 48 playoff games for some form of redemption from what occurred in 2001, had other ideas. This time, Carter lived up to his Half-Man, Half-Amazing moniker as he delivered one of the Vinsanity moments.

Owner Mark Cuban said: “The basketball gods were smiling on us.”

The Spurs appeared to be in solid position to take back home-court advantage after the Mavericks earned a 1-1 split of the first two games in San Antonio. A 3-pointer by Kawhi Leonard and a baseline jumper by Boris Diaw snapped a 95-all tie and pushed the Spurs ahead 100-95 with 2:13 left.

But Dirk Nowitzki (18 points) made a pair of free throws, and Monta Ellis (career playoff-high 29 points) scored to get the Mavericks within one. Tim Duncan’s two free throws padded the Spurs’ lead to three before Ellis tied it with a 3-point play with 1:10 left.

The two teams went back and forth like two prize fighters before Ellis charged in and tossed a shot over Duncan to knot the score at 106-106 with 24.2 seconds remaining.