DALLAS, Feb. 7 (Ticker) -- The Detroit Pistons were shaking their heads in their previous visit to the American Airlines Center. They probably will be doing the same after one of the best games of Dirk Nowitzki's career.

NBA TV highlights from
Pistons-Mavs:
56k | 300k
Nowitzki shook off a slow start to score 40 points as the Dallas Mavericks pulled out an exciting 111-108 victory over the Pistons.

In their last visit to Dallas, the Pistons suffered a 114-75 loss on Nov. 9, 2002. Nearly 15 months later, the score was not as lopsided but still resulted in a tough loss for Detroit. It had no answers for Nowitzki, who made 15-of-24 shots.

Nowitzki missed his first five shots as the Mavericks were dominated physically and found themselves in a 15-point hole early in the second quarter. But behind Nowitzki, Dallas climbed back into it.

"I think I started off kind of slow," Nowitzki said. "Actually I felt great in warmup and I felt like I had a lot of energy. My first couple of shots I kind of rushed them. I wasn't really taking my time and I was kind of overexcited.

"Once the first shot fell, I felt great throughout the whole game. I felt I could take anyone off the dribble and pull up with a jumper. That's what I tried to do."

The Mavericks rallied from their second-largest deficit of the season and improved to 8-14 when trailing by double digits at some point.

"It helps when Dirk heats up and makes all his shots," Dallas coach Don Nelson said. "It makes the coach look good when he's running plays. He was on the end of a lot of the plays we were running."

In a back-and-forth game, the Mavericks never trailed after Antoine Walker's follow shot made it 101-100 lead with 2:24 to play. Steve Nash, who scored 29 points on his 30th birthday, made a runner on the next possession for a three-point edge.

Behind Nowitzki and Nash, the Mavericks won for the 12th time in 14 games. The duo combined to make 24-of-35 shots as Dallas shot 55 percent (41-of-74) from the floor.

After Corliss Williamson's jumper made it a one-point game, Nowitzki hit his final jumper of the night to make it 105-102 with 95 seconds remaining.

"They couldn't have had two guys play any better, making any bigger shots," Detroit coach Larry Brown said. "They are not going to make all those shots all time. It was just one of those nights where they did."

"Dirk was great," Nash said. "After a somewhat slow start, I think he went on to put on a clinic out there. He really carried us in stretches and he was really aggressive."

Nowitzki scored 17 of Dallas' 23 points in the third period, nine in the game's final seven minutes and made two big defensive plays down the stretch. Nash made six straight foul shots in the final 19 seconds.

Chauncey Billups scored 17 points but missed a pair of key jumpers in the final minute as Detroit lost for the sixth time in 10 games.

"We had it where we wanted to," said Pistons guard Richard Hamilton, who scored 16 points, "There were times in the end where we should have maybe slowed it down a little bit, things like that. Dirk hit some tough shots. He hits some big shots for them."