After two months of rehabilitation to attempt a return to the New York Knicks, All-NBA forward Julius Randle will undergo season-ending right shoulder surgery, the team announced Thursday.

Randle, who has been out since dislocating his shoulder on Jan. 27, had been relentlessly rehabilitating to resume playing prior to the Eastern Conference playoffs. Doctors warned him recently that continued instability in the shoulder made it unsafe for him to play again this season, sources told ESPN.

He had done everything possible to avoid surgery and return for the playoffs. However, the procedure became an increasing inevitability after recent visits to two specialists who warned of further injury and possible permanent damage to the shoulder if he returned to play before a surgical procedure, sources said.

Randle’s surgery is expected to allow for a full recovery and return around the start of the 2024-25 season, sources said. Undergoing the surgery soon gives him the recovery time necessary to target that timeline.

The Knicks said Randle would be reevaluated in September.

This is a significant blow to a Knicks team that has shown promise of making a postseason run. New York (44-31) was 12-2 with Randle and OG Anunoby in the lineup together and had the league’s No. 1 defense during those 14 games. The Knicks have largely played the past two months without Anunoby and Randle but are in fifth in the East and only one game out of the third seed.

Randle’s recovery and return next season — along with the re-signing of Anunoby — could make the Knicks one of the favorites in the Eastern Conference.

Randle, who earned his third All-Star selection this season, was averaging 24 points on 47% shooting, 9.2 rebounds and 5 assists per game. At one point this season, he had 19 consecutive games with 20 points or more — the longest streak of his career, according to ESPN Stats & Information.

Randle, 29, had played in all of the Knicks’ 46 games before getting injured against the Miami Heat. He has twice been voted a second-team All-NBA performer with the Knicks (2021, ’23).

He had offseason ankle surgery in the summer of 2023, after playing through an injury to compete in the late season and playoffs for New York.