BOSTON — When you’re sitting on the NBA’s best record like the Golden State Warriors, you don’t have to stress over every single game.

Because you usually win, anyway.

Stephen Curry scored 37 points Sunday night, and the Warriors erased a 26-point deficit to beat the Boston Celtics 106-101. Golden State won for the seventh time in nine tries to improve its league-best record to 46-11.

“This was a fun challenge for us,” Coach Steve Kerr said. “If we lost, it wouldn’t have been the end of the world. But we were down and we came back. I was happy that we showed good poise.”

Klay Thompson scored 20 points for the Warriors, Harrison Barnes had 17, and Draymond Green scored 11 of his 14 points in the fourth quarter.

Isaiah Thomas scored 20 points off the bench for Boston, which had its three-game winning streak snapped. The Celtics led 56-30 midway through the second quarter, bringing the usually quiet TD Garden back to life.

“Twenty-whatever we were up in the first half felt like three to me,” Boston Coach Brad Stevens said. “And 16 at halftime feels like two against those guys. They just come back so fast.”

Jae Crowder had a career-high 17 rebounds to go with his nine points, but his 3-pointer with a chance to give Boston the lead with under a minute left rolled around the rim and out. Andre Iguodala followed with a layup to give Golden State a three-point lead, driving down the center of the lane as the final seconds ticked off the shot clock.

Thomas made a layup, then Curry sank two free throws to make it 104-101 with 10.5 seconds left.

Thomas had an open 3-pointer, but it bounced off the back of the rim and Curry grabbed the rebound.

He made another pair of free throws to clinch it.

“We didn’t want to be down 26,” Curry said after the Warriors played their fifth game on a six-game road trip, and the middle of a string of three games in four nights.

“It seemed like it was sluggish there in the first quarter. We had to be mentally tough to make it an interesting game and close out the half.”

It’s the first time since the Warriors moved west from Philadelphia in 1962 that they have won four straight games against the Celtics.

Boston led by 13 at the end of the first quarter despite 14 points from Curry. Boston stretched it to 56-30 on back-to-back 3-pointers by Crowder and Jonas Jerebko midway through the second.

But the Warriors cut the deficit to 16 points by halftime and scored nine straight points early in the third quarter – seven of them by Curry – to bring it into single digits.

It was 86-75 after three quarters before Golden State scored the first six points of the fourth – a 3-pointer by Green and Shaun Livingston’s three-point play.

Trailing 92-87, the Warriors went on a 9-2 run, tying it 94-all on Iguodala’s dunk and then taking the lead on Green’s tip-in.

NOTES: The Warriors gave up 17 fast-break points in the first half before scoring their first. …

Golden State finishes its six-game road trip – and a stretch of four games in five nights – Monday at Brooklyn.

Boston’s next win against the Warriors will be its 200th against the franchise. …

Thomas said he was surprised he had an open look at a 3-pointer to tie the game on Boston’s last real possession. Tyler Zeller set the screen that freed him up.

“I thought it was going in,” Thomas said. “It was on line. But it just didn’t fall.”

It was Thomas’ fifth straight game with at least 19 points off the bench. According to the Elias Sports Bureau, the last Celtic to do it four times in a row was Hall of Famer Kevin McHale in 1989-90.