BOSTON — Jason Terry scored Boston’s last nine points and the Celtics weathered a strong comeback by the New York Knicks, avoiding a first-round sweep in the NBA playoffs with a 97-90 overtime win Sunday.

Paul Pierce led the Celtics with 29 points as they forced a fifth game in the series, but it was Terry who provided the finishing touches.

In Game 3, he had been elbowed by J.R. Smith, and the NBA suspended the Knicks guard for Sunday’s game.

New York had tied the game 84-84 after trailing by 20 points early in the third quarter. It was 88-all before the Celtics regained control and took the lead for good on a 3-pointer by Terry. Carmelo Anthony, who led the Knicks with 36 points, hit a short jumper, but Terry connected on a 15-footer with 50 seconds remaining for a 93-90 lead.

After Anthony missed a 3-pointer with 21 seconds to go, Terry was fouled and sank both free throws. He added a layup to close out the game.

But the Celtics still have a huge deficit in trying to become the first team to win after trailing a series 3-0.

Game 5 is Wednesday night in New York, where the Knicks can win their first playoff series in 13 years.

Jeff Green scored 26 points for the Celtics, and Terry finished with 18.

The Celtics showed renewed energy early after being held below 80 points in each of the first three games.

They led 54-35 at halftime and 59-39 three minutes into the third quarter before their recent second-half woes returned. In previous first halves, they scored just 25 points in Game 1 and 23 in Game 2.

On Sunday, they were outscored 30-14 in the third quarter and led just 68-65 heading into the fourth.

Boston held a 65-51 lead when Anthony went to the bench with 3:35 remaining. The Knicks outscored the Celtics 14-3 the rest of the way behind 11 points from Felton and a 3-pointer from Iman Shumpert. Felton finished with 16 points in the quarter and 27 in the game.

The Knicks played the first half as if they had taken shooting lessons from the Celtics. New York hit just 28.9 percent of its shots (11-for-38) after Boston made only 39.5 percent of its attempts in the first three games.

The Celtics found their range from the start and connected on 51.3 percent (20-for-39).

Spurs 103, Lakers 82: In Los Angeles, Tony Parker scored 23 points, and the San Antonio Spurs completed their first-round sweep of the injury-plagued Lakers.

Tim Duncan had 11 points and six rebounds for the second-seeded Spurs, who will face the winner of Denver’s series with Golden State in the second round. They’ll get plenty of rest after flattening the Lakers, who finished without three regular starters in their first opening-round exit since 2007.

In his final game before unrestricted free agency, Dwight Howard scored seven points before getting ejected early in the third quarter for arguing.

Pau Gasol had 16 points for the Lakers, who were swept from the postseason for the second time in three years despite a late courtside appearance by Kobe Bryant on crutches.

In the final game of a season that began with championship aspirations, the Lakers couldn’t keep up without injured starters Bryant, Steve Nash and Metta World Peace. They had just nine available players in uniform for the final minutes.

Parker took the lead in the clincher, scoring 15 points in the first half while exploiting the Lakers’ hastily assembled backcourt. Los Angeles’ top four guards are out with injuries, including backups Steve Blake and Jodie Meeks, and Parker was merciless against third-stringers.

Heat 88, Bucks 77: In Milwaukee, Miami’s Big Three finally have their sweep.

LeBron James scored 30, Ray Allen had another big game against his old team and the Miami Heat advanced to the Eastern Conference semifinals.

It’s the first time the Heat have swept a playoff series since James and Chris Bosh joined Dwyane Wade in Miami three years ago.

And the Heat didn’t even need Wade to do it. The guard missed a postseason game for the second time in his career and first since 2005 because of three bone bruises on his right knee.

But the Heat still advanced handily, winning their fourth straight game by double digits. Wade will get plenty of time to rest now, too. The Heat will face the winner of the Brooklyn Nets-Chicago Bulls series — Chicago leads 3-1 — but the next round won’t begin until Saturday.

Allen had 16 points on 5-of-10 shooting, including 4-of-7 from 3-point range. Udonis Haslem added 13 points and five rebounds, and Mario Chalmers kicked in eight rebounds and six assists.

Monta Ellis led the Bucks with 21 points, and Larry Sanders had 11 rebounds to go with seven points. But Milwaukee got almost nothing from Brandon Jennings, who didn’t even play in the fourth quarter. Jennings, who had guaranteed the Bucks would win the series in six games, finished with three points on 1-of-7 shooting and had two turnovers.

The Heat had won the first three games easily. But that was with Wade on the floor. He led Miami in scoring in Game 2, and his defense was key in Game 3.

But Wade got knocked around hard Thursday night, and the Heat decided it wasn’t worth risking further aggravating his knee Sunday.

Wade missed six games near the end of the regular season with three bone bruises around his right knee — one above, below and to the side of the kneecap.