PORTLAND, Ore. — With a drama-filled victory over the Warriors that included the ejection of Golden State coach Steve Kerr, the Portland Trail Blazers got a confidence boost heading into the All-Star break.

“It’s really important when you can collect yourself and come home against the best team in the league right now, and just get it done,” Lillard said. “I thought that said a lot about our team, our growth.”

Kevin Durant and Stephen Curry each had 32 points for the Warriors, who rested DeMarcus Cousins following a victory at home over Utah the night before. Despite the loss, which ended an 11-game winning streak on the road, Golden State still goes into the break with the best record in the Western Conference.

After a tight three quarters, Layman’s long jumper gave Portland a 104-101 lead in the final period before Zach Collins blocked Damion Lee’s layup on the other end.

Collins and Klay Thompson exchanged words, and the frustration spilled over to players from both sides. The two players were given offsetting technical fouls.

Portland led 110-103 before Draymond Green was called for a flagrant foul on Collins with 3:54 left. Kerr reacted angrily, throwing his clipboard to court and yelling at the officials before he was ejected. Durant had to hold back the irate Warriors coach before he finally went to the locker room.

Lillard made the three technical shots and Collins made his free throws to give Portland a 115-103 lead. Layman added a 3-pointer to all but seal the win. The Warriors finished with just 12 points in the final quarter.

Green praised Kerr for standing up for him: “That was amazing, he was great. I enjoyed that.”

Kerr said he was shocked when officials looked at the replay and determined it was a flagrant.

“We’ll obviously get an explanation from the league, but I just thought it was a good, hard foul,” Kerr said. “I guess I was wrong.”

In addition to Cousins, the Warriors rested guard Shaun Livingston and forward Andre Iguodala. Kerr said before the game that Cousins and Livingston got the night off because of the back-to-back games, and Iguodala was additionally a “little banged up.”

The Warriors started Kevon Looney in Cousins’ place.

Durant led all scorers with 16 points in the first quarter, and Golden State led 33-31. Durant played just five minutes of the second quarter as the Warriors turned to their bench and finished the half with 20 points.

The first half was close — Portland held a 64-61 lead at the break — and it stayed close in the third quarter. Looney’s basket tied it at 75 with just under nine minutes to go in the period.

The game first got testy midway through the quarter when Durant pushed Jusuf Nurkic after the two appeared to exchange words, but the officials quickly defused the situation.

Curry made back-to-back 3-pointers and the Warriors took a 93-88 lead, but Lillard answered with a 3.

The Blazers had eight players in double figures for the second time this season. Nurkic had 11 points and 11 rebounds.

It was the last game before the All-Star break for both teams.

“(I’m) really pleased with where we are at the All-Star break,” Kerr said. “Everybody’s gonna have a chance to get away a little bit, then come back for the stretch run.”

Earlier, the Blazers signed center Enes Kanter. The Knicks, who decided to focus on younger players, were unable to deal Kanter before the trade deadline and waived him instead.

Blazers coach Terry Stotts said Kanter will join the team for the Feb. 21 game against Brooklyn following the All-Star break. Kanter will back up Nurkic.