Rajon Rondo had already played two games since returning from a sprained ankle. It wasn't until Wednesday night, though, that he really returned.

The Celtics point guard had 22 assists, 12 points and 10 rebounds for his 11th career triple-double, adding six steals to help Boston beat the San Antonio Spurs 105-103 in a matchup of the NBA's top two teams.

"I felt a lot better in the past couple of games," said Rondo, who also played 43½ minutes just three games after missing two weeks with an injury. "I'm in a little better rhythm, and I'm able to push off push off a little bit more on my ankle."

Ray Allen scored 31 points and Glen "Big Baby" Davis had 23 — one short of a career high — playing in place of the injured Kevin Garnett. Manu Ginobili scored 24 points with eight rebounds for the Spurs (29-6), who still have the best record in the NBA despite losing back-to-back games for the first time all season.

"We're not satisfied with where we are, and honestly I don't really care what our record is," San Antonio forward Tim Duncan said. "(With) the kind of defense we're playing, we're definitely not satisfied with where we are right now.

Allen made 13 of 16 shots to help the Eastern Conference-leading Celtics (27-7) shoot 61 percent from the floor as a team. But he also missed a pair of free throws with 8.1 seconds left and the Celtics up by two.

After a timeout, Ginobili worked down the clock and put up a shot that Pierce blocked and Rondo pulled down for his 10th rebound.

Rondo's 22 assists were the second-most in his career; he had 24 in an Oct. 29 game against the New York Knicks that was his only other triple-double this season. His six steals were a season-high and one off his career-high, and he scored eight points in the fourth quarter when the Spurs began playing him to pass.

"He did it all," Pierce said. "Rebounded. Assisted. Doc's kind of been on him about taking that shot there. And he steps up when he needs to and knocks down those shots confidently."

Tim Duncan and Tony Parker had 18 points apiece for the Spurs, who were coming off a 128-115 loss to the Knicks in New York on Tuesday in which coach Gregg Popovich pulled his three stars with more than three minutes left, down by just 11.

"This is a different game than New York," Ginobili said. "New York, we went out there and they beat us in every single area of the game. Today was different."

And it turned out the Spurs needed the extra rest in a game against Boston that went down to the wire.

Boston's 61.3 percent shooting percentage was the highest for a Spurs opponent since 1988, according to STATS LLC.

"The fact that we shot 61 percent ... and won by two is a scary number, when you think about it," Celtics coach Doc Rivers said. "It took a 61 percent effort from us tonight to win a basketball game at home. That tells you how good that team is."

Popovich joked that Allen dragged the team down by missing three shots.

"If it was practice ... I don't know if anyone in the league would hit 13 out of 16. He does it in a game," Popovich said. "I think he's pretty good."

San Antonio took a 70-67 lead on Duncan's hook shot with 3:37 left in the third quarter, but they did not score again until George Hill beat the buzzer with a bank shot. In the meantime, Boston scored 10 straight points, including a 3-pointer from Pierce to tie it and his slamming, swinging-from-the-rim dunk that made it 77-70.

But it was 96-all when Rondo grabbed his ninth rebound and worked the ball down to Marquis Daniels for a layup, then Pierce found Allen for a 3-pointer that made it 101-96 with 97 seconds left. After Davis drew an offensive foul on Richard Jefferson, Rondo drove into the lane and floated one over Duncan to make it 103-96.

Allen stripped the ball away from Hill and went in for the layup and Boston's biggest lead of the game.

But Ginobili hit a 3-pointer, Parker drove for a layup and then Jefferson hit a pair of free throws to cut the Spurs' deficit to two points. With Boston still leading 105-103, Pierce missed a jumper but Nate Robinson pulled down the rebound and got the ball to Allen, who was fouled.

He missed both free throws. It's just the second time in 50 weeks that Allen, a career 89 percent foul shooter, has missed two free throws in a game.

Notes: The Spurs waived backup swingman Ime Udoka during the day. Udoka played sparingly in 20 games after being signed in November. It was his second stint with the Spurs after spending two seasons in San Antonio following the team's last championship in 2007. ... San Antonio rookie James Anderson is expected back soon after missing the last two months with a stress fracture in his foot. ... Jermaine O'Neal fouled out with 3:13 left. ... Pierce was called for a technical foul with 4:55 left for complaining about a foul non-call. That helped the Spurs tie it at 90.... Boston is 3-1 since Garnett went out with a right calf injury.