Tests confirmed that Golden State Warriors wing Moses Moody suffered a torn left patellar tendon, the team announced Tuesday, ending his season.

Surgery is set for Thursday, league sources said. Moody faces a lengthy rehab process that is expected to impact his availability into next season.

Moody suffered the noncontact injury late in the Warriors’ 137-131 overtime win in Dallas on Monday night when his left knee buckled while planting for an attempted transition dunk.

Moody had missed the previous 10 games because of a right wrist sprain. In his return, Moody was having one of his best games of the season. He had 23 points when he ripped the dribble of Mavericks rookie Cooper Flagg and pushed his third steal of the night ahead for what would have been a wide-open transition dunk to punctuate the win with one minute left.

But he was never able to complete the dunk attempt. Moody tore the tendon when he planted his left leg and immediately grabbed at it, falling to the floor under the basket near the Warriors bench as the Mavericks grabbed the loose ball.

Play continued for several seconds as Moody remained down. After the next whistle, teammates, staff and trainers gathered around Moody to check on him. Arena workers brought out a stretcher, and the game was stopped for several minutes. Veteran teammate Draymond Green embraced Moody with a hug as he was wheeled down the tunnel.

“It’s brutal. You know, we’ve been waiting [for him] to get back healthy,” Green told ESPN Radio after the game. “Moses is a guy who does everything right.”

Rick Celebrini, the Warriors’ lead medical decision-maker, pushed Moody out of the arena in a wheelchair. Moody flew back to the Bay Area with the team and received confirmation of the diagnosis after an MRI in San Francisco on Tuesday afternoon.

“Mo is such a great human being,” Kerr said. “Great teammate. Wonderful guy to coach. Just puts in the work every day and was brilliant [Monday night], by the way.”

This is the latest in what has been a wave of devastating injury luck for the Warriors. Veteran wing Jimmy Butler tore an ACL in early January. Star guard Stephen Curry will miss his 23rd consecutive game Tuesday night because of a persistent right knee issue. Starting center Al Horford is currently out because of a calf strain.

Amid these injury absences, the Warriors have lost 16 of their past 23 games, falling to 34-38 and 10th in the Western Conference.

But the bigger picture question is how this will impact next season as the Warriors try to claw back into contention before Curry, 38, retires.

Butler’s ACL rehab and Moody’s presumed timetable are expected to keep them sidelined for at least a large portion of next regular season, meaning the Warriors will be without their second-best player and a starting wing.

Moody was averaging a career-high 11.9 points this season, his fifth in the NBA. He is on the first season of a three-year, $39 million extension.