Kobe Bryant can gush about the Boston Celtics all he wants: The Los Angeles Lakers legend still would do whatever it takes to beat his old nemesis, and he nearly did just that Sunday night.

Bryant put on a vintage performance at Staples Center, scoring a game-high 34 points in his final game against the Celtics. Bryant’s heroics helped the lowly Lakers hang around all night, but the C’s finished strong to earn a 107-100 win and close out their five-game West Coast swing on a high note.

Isaiah Thomas nearly matched Kobe blow-for-blow, scoring a team-high 26 points on 10-of-20 shooting and adding six assists. Jae Crowder tallied 22 points in his return to action, while Amir Johnson notched a double-double with 10 points and 13 rebounds.

The Celtics clinched a playoff berth with the win and moved into a tie with the Atlanta Hawks for third place in the NBA’s Eastern Conference.

Isaiah Thomas, Evan Turner, Jae Crowder, Amir Johnson, Jared Sullinger

Bryant came to play in his final game against Boston. The Lakers legend scored 11 points in nine minutes of playing time in the first quarter, drilling his first two shots and keeping L.A. in it by making all six of his free throws in the frame.

On the other end, another veteran — albeit a less-seasoned one — stepped up big for Boston in the first quarter. Johnson tallied eight points and pulled down an incredible nine rebounds through the first 12 minutes, as the Celtics shot 59 percent from the field in the period to take a 31-26 lead.

The Celtics struggled early in the second quarter and continued to let the Lakers hang around. Then Thomas and Terry Rozier stepped on the floor.

With Boston leading by just three points, Thomas took center stage, going on a 10-3 run all by himself to stretch the Celtics’ lead to double digits. Rozier did his part, as well, tracking down loose balls and driving to the hoop with purpose as part of a four-point, five-rebound first half.

Thomas scored 21 points in the first half on 8-of-11 shooting, but a late Lakers run aided by two more Bryant buckets brought Boston’s lead down to nine at halftime.

Bryant and the Lakers took that momentum into the second half, roaring back to make it a ballgame as things got intense between the storied rivals, despite their disparate records.

L.A. scored 11 of the third quarter’s first 13 points, completing a 19-2 run that erased Boston’s 17-point lead. Bryant continue to pour in the points, knocking down a pair of 3-pointers to help the Lakers actually pull ahead of the C’s.

The close game boosted the intensity at Staples Center, as Thomas was called for a technical foul after getting into a spat with Lakers guard Marcelo Huertas. The Celtics went on a 6-2 run to enter the fourth quarter with a slim two-point lead.

The Celtics hit several key shots in the fourth quarter to spoil Bryant’s last hurrah.

Crowder nailed a 3-pointer early in the frame as part of a 7-0 run that gave Boston some breathing room, and Evan Turner buried a corner three off a Rozier pass to put the C’s up 11. Bryant kept the heat on with a difficult fallaway jumper that cut the Celtics’ lead to six, but Boston immediately responded with a Thomas layup and a Marcus Smart 3-pointer to go back up 11.

The Lakers pulled to within four after a Julius Randle layup-and-foul with under 30 seconds to go, but the C’s hit their free throws down the stretch to hold on for the victory.

The Celtics had a pretty rough third quarter, but this Smart-to-Turner-to-Jonas Jerebko connection was nothing to sneeze at.

A long-awaited trip back home. The Celtics will return to the East Coast this week for two home games against the New Orleans Pelicans and Milwaukee Bucks. They’ll take on the Pelicans on Wednesday at TD Garden, then stay in Boston battle the Bucks on Friday night. Wednesday’s tip-off is set for 7:30 p.m. ET.

Thumbnail photo via Richard Mackson/USA TODAY Sports Images

Thumbnail photo via Los Angeles Lakers guard Kobe Bryant controls the ball against Boston Celtics forward Jae Crowder (99) during first half at Staples Center.