BOSTON — The Celtics did everything but beat the Golden State Warriors on Friday night.

Boston gave the undefeated Warriors their toughest test of the season, forcing two overtime periods before finally falling 124-119 in front of a raucous TD Garden crowd that created a playoff-like atmosphere.

Reigning NBA MVP Stephen Curry scored a game-high 38 points but shot just 9 for 27 (33 percent) from the field and committed eight turnovers thanks to a ferocious defensive effort led by Celtics guard Avery Bradley.

Bradley fouled out early in the first overtime, however, and the Celtics just didn’t have enough gas left in the second OT to prevent the Warriors from moving to 24-0.

Kelly Olynyk poured in a season-high 28 points, while Bradley added 19 and Isaiah Thomas tallied a double-double with 18 points and 10 assists.

Isaiah Thomas, Avery Bradley, Jae Crowder, Amir Johnson, Jared Sullinger

Thomas had two chances to win it but failed to deliver both times.

Warriors guard Shaun Livingston blocked Thomas’ 3-point attempt with 1.2 seconds remaining in regulation to send the game into overtime.

Thomas also had the ball in his hands at the end of the first overtime, but his short floater missed the mark to extend the game into two OTs.

Bradley, not Curry, was the sharpest shooter on the floor in the first quarter.

The Celtics guard set the tone right out of the gate. He brought an energized TD Garden crowd to its feet by knocking down five of his first six shots and finishing with 15 points in the opening 12 minutes.

Bradley also brought his game defensively, holding Curry to just 2 for 8 shooting in the first frame.

Bradley went ice cold after the first frame, but Evan Turner and the Celtics bench helped the home team stay afloat in the second quarter.

Turner was responsible for Boston’s first eight points in the period, finding a cutting Olynyk with a slick pass and hitting his next three shots to help the Celtics stay in it with Curry off the floor. Boston’s bench scored 16 of the team’s 28 points in the quarter.

There was plenty of intensity to go around in this one.

Warriors forward Draymond Green was at the center of the chippy play, getting into it with former college rival Jared Sullinger in the second quarter.

Moments later, Green went back to the chest thump after blocking an Isaiah Thomas shot.

The Celtics’ defense did its job in the third quarter. The offense? Not so much.

Bradley and Crowder turned up the heat defensively after halftime, forcing the Warriors into uncharacteristic turnovers and missed shots.

Boston failed to capitalize on the other end, however. The C’s shot just 29 percent from the field in the third quarter, allowing Golden State to open up a slim lead.

The Celtics fed off a lively TD Garden crowd to surge back with an impressive run.

Boston trailed by as many as 11 points in the third quarter. But Curry headed to the bench late in the frame after picking up his fourth personal foul, and the Celtics responded by outscoring the Warriors 19-7 to take a three-point lead before Curry re-entered.

Amir Johnson established Boston’s defensive presence early with this first-quarter swat on Green:

There’s no respite for the Celtics, who will return to the road Saturday to take on the Charlotte Hornets. The Hornets own No. 2 seed in the Eastern Conference with an impressive 14-8 record. Tipoff in Charlotte is scheduled for 7 p.m. ET.

Thumbnail photo via Winslow Townson/USA TODAY Sports Images

Thumbnail photo via Boston Celtics guard Evan Turner (11) and Golden State Warriors forward Andre Iguodala (9) battle for a loose ball during the first half at TD Garden.