SAN ANTONIO – Rajon Rondo had 22 points and 14 assists, Paul Pierce scored 21 and the Boston Celtics stopped slipping further from first in the Eastern Conference, beating the slumping San Antonio Spurs 107-97 on Thursday night.

Kevin Garnett added 20 points and the Celtics, winning for just the second time in five games, moved within two games of Chicago for the No. 1 playoff seed in the East.

The Spurs stayed stuck in an untimely tailspin. The NBA’s winningest team lost its fifth in a row and is in danger of falling out of first place after comfortably being No. 1 in the West all season.

Tony Parker led the Spurs with 23 points and Tim Duncan, playing for the first time in five games after spraining his ankle last week, had 20 points and 13 rebounds.

The Celtics celebrated the return of their own big man, center Jermaine O’Neal, who played for the first time since January after having arthroscopic surgery on his left knee. He scored five points in 11 minutes and hit his only two shots.

“We need him back,” said Celtics Coach Doc Rivers before the game, alluding to his depleted frontcourt that is still without Shaquille O’Neal. “And we need the minutes.”

Pierce also had 11 rebounds and Glen Davis scored 16 points as Boston had four players score in double figures.

The Celtics broke open a tie game at halftime behind a 12-0 run in the third quarter. The Spurs never got closer than six after that.

The Celtics arrived in San Antonio after losing to Indiana, Charlotte and Memphis in three of their last four games. Two weeks ago, Boston (52-22) was tied for first place in the East.

Miami has also crawled back into contention for first, sitting a half-game behind Boston, but a big win against the toughest opponent they’ve seen in weeks kept the Celtics ahead of the Heat.

The Spurs (57-18) had nine losses at the All-Star break. They’ve dropped more than half that number of games in the past week alone.