Rajon Rondo had a chance to win it in regulation and Derek Fisher got enough of the shot to keep it from traveling more than a few feet.
Then Paul Pierce's shot at a game-winner at the end of the first overtime was blocked by Dahntay Jones.
There was still plenty of time for Pierce and Rondo to come through.
Pierce made a 3-pointer at the start of the second extra period to give Boston the lead for good, and the Celtics held on for a 117-115 victory over the Dallas Mavericks on Wednesday night.
Pierce scored 34 points in all, and Rondo had 16 points, 15 assists and nine rebounds in a career-high 52 minutes, 30 seconds.
"We ask him to do a lot," Pierce said of Rondo. "We ask him to push it up, score and rebound. We ask him to do a lot because he can do it."
Pierce had four points in the first overtime - putting him over 23,000 points in his career - and eight in the second. Rondo, who played the entire first OT and all but 2 seconds of the second, had the only other basket in the second overtime before Courtney Lee made a pair of free throws with 6 seconds to play.
"I thought the biggest mistake I made was leaving Rondo in that long," Celtics coach Doc Rivers said. "I thought that had an impact on the speed of the game."
Kevin Garnett added 16 points for Boston, and Jason Terry had 10 points against the team he played with for eight seasons.
O.J. Mayo scored 24 points for Dallas, and Shawn Marion had 16 points, 11 rebounds and seven assists. Mayo, who played 51:55, also had nine of the Mavericks' 28 turnovers.
"I wasn't tired at all. You just can't turn the ball over. Look at the stats, man: nine turnovers out of 28," he said. "We had plenty of opportunities to take control of that game and win. We've got to be better in that area. We just can't turn the ball over."
Boston led by 14 in the third quarter and eight after the first basket in the fourth before Dallas chipped away at the deficit and tied it at 92 on Darren Collison's drive to the basket. After Rondo made a jumper, Fisher hit a 3-pointer with 1:47 left in the fourth to give the Mavericks their first lead of the game.
Pierce came out in the second overtime and hit a 3 to make it 108-105. Mayo's basket made it a one-point game and the tired teams struggled to score until Rondo drove to the basket to give Boston a 110-107 lead with 36 seconds to play.
From there, Dallas was forced to foul.
Pierce sank one of two free throws and Vince Carter hit a 3-pointer with 10 seconds left to make it 111-110. Pierce hit another pair of foul shots and Collison hit two free throws before Pierce and Courtney Lee each made two.
Mayo hit a meaningless 3-pointer at the buzzer to make it a two-point final margin.
The Celtics never trailed, opening a six-point lead in the first quarter and leading by as many as 10 in the second before Dallas scored 8 of the last 11 points in the half to head into the break down just 48-43.
Boston opened a 14-point lead early in the third quarter before the Mavericks scored 10 of the next 12 points. After Rondo drove to the basket to give Boston a 78-70 lead with the first score of the fourth quarter, the Mavericks went on a 7-2 run - five of those points coming from Mayo - to make it a three-point game.
This program aired on December 13, 2012. The audio for this program is not available.