Bucks forward Khris Middleton had a surgical procedure on his right knee after Milwaukee was upset in the first round by eventual Eastern Conference champion Miami Heat, sources confirmed to ESPN on Thursday.

Middleton, 31, dealt throughout the season with issues with his right knee, which he injured last season during the Bucks’ first-round playoff victory over the Chicago Bulls. The injury caused Middleton to miss all of Milwaukee’s seven-game loss to the Boston Celtics during the 2022 Eastern Conference semifinals. He then played only 33 regular-season games this season because of a combination of issues, including the right knee and recovery from the left wrist surgery he had last offseason.

The three-time All-Star averaged 15.1 points, 4.2 rebounds and 4.9 assists during the regular season, before jumping up to 23.8 points, 6.4 rebounds and 6.2 assists during Milwaukee’s five-game upset loss to Miami in the first round of the playoffs. Middleton also shot 46 percent from the field and 40 percent from 3-point range on over six attempts per game against the Heat.

Middleton can opt into a $40.3 million player option for the 2023-24 season, or become an unrestricted free agent if he chooses to opt out. Assuming he declines his option, Middleton and Bucks center Brook Lopez will be two of the most talented and intriguing free agents on the market this summer.

After losing to Miami in the first round, Milwaukee fired coach Mike Budenholzer, replacing him with former Toronto Raptors assistant Adrian Griffin. The Bucks also can offer superstar forward Giannis Antetokounmpo an extension in September, as he enters the offseason with two guaranteed years left on his contract.

Middleton’s surgery was first reported by the Milwaukee Journal-Sentinel.