Updated

SAN ANTONIO, Texas (Reuters) - The Dallas Mavericks exploded for 42 points in the fourth quarter to pull away from divisional rivals the San Antonio Spurs for a 112-103 victory on Friday.

Dirk Nowitzki led the charge by scoring 16 of his team-high 26 points in the final period as the Mavericks gained a three-game lead over the Spurs in the Southwest Division.

"We just kept hanging in there, as they played some tough defense on us," Nowitzki told reporters.

"I missed a lot of shots, so we had to learn how to buckle down defensively... make it tough for (Tim) Duncan and keep (Manu) Ginobili out of the lane."

Perennial All-Star Duncan powered to 31 points and 12 boards for San Antonio (21-13), who led 80-67 with 12 seconds remaining in the third quarter.

Dallas turned things around once Nowitzki got hot from the outside, leading a 20-5 stretch to give the visitors a 100-92 advantage with less than four minutes to go.

Nowitzki made just 10 of 28 field goals but was unstoppable in the fourth where he made a back-breaking three-pointer with 51 seconds left as the Spurs had pulled within four.

Jason Terry added 21 points and eight assists to help the Mavericks (25-11) improve to 13-6 on the road, the best record in the Western Conference.

Erick Dampier returned to the court after missing two straight games with a knee injury and had 14 points on a perfect 6-for-6 shooting.

"Damp is so important to us, especially against these guys because he's the only guy that normally has the length to battle Duncan on the inside," said Mavericks coach Rick Carlisle.

San Antonio point guard Tony Parker had 21 points after having missed the previous two meetings with Dallas due to injury.

The Spurs entered the night having won 12 of their last 15 as they regain health and form since starting the year 9-9.

Against the Mavericks, San Antonio endured an up and down game that featured 10 lead changes with the Spurs trailing for much of the second before snagging a halftime advantage and moving well in front in the third.

(Writing by Jahmal Corner in Los Angeles; Editing by John O'Brien)