After overseeing the Lakers’ finish with their worst record in franchise history for two consecutive years, Byron Scott will not coach the team in the 2016-17 season, sources said on Sunday night.

The Lakers later announced they chose not to exercise the team option for Scott’s third and fourth season. The third year of his deal was not fully guaranteed, according to a league source familiar with the terms.

• MARK WHICKER: Byron Scott failed in a no-win situation

“We would like to thank Byron for his hard work, dedication and loyalty over the last two years but have decided it is in the best interest of the organization to make a change at this time,” Lakers general manager Mitch Kupchak said in a statement.

• THE CANDIDATES: Who will be the next coach of the Lakers?

The Lakers said a coaching search will “begin immediately.” Yet it is not immediately clear who will replace Scott, or if the team will retain any of his assistants, which include Paul Pressey, Mark Madsen, Larry Lewis, Jim Eyen and Thomas Scott. The Lakers lost out on potential coaching candidates after mulling Scott’s future for the past week. Those possibilities included Tom Thibodeau (Minnesota) and Scott Brooks (Washington), both of whom would have been interested in the job, according to sources familiar with their thinking. Possible replacements could include Golden State Warriors assistant Luke Walton, former Rockets and Knicks coach Jeff Van Gundy, Connecticut coach Kevin Ollie and San Antonio Spurs assistant Ettore Messina.

Scott will end his two-year stint with the Lakers with a combined 38-126 record, which pits him just above George Mikan for the franchise’s worst all-time winning percentage among its 20 coaches. Scott compiled a .232 winning percentage, while Mikan had a .231 winning percentage when the 1958 Minneapolis Lakers went 9-30.

Nonetheless, Scott had impressions from the Lakers up through late last week that he would be retained, according to a source familiar with his thinking. Scott learned otherwise on Sunday evening when he met with Kupchak at the Lakers’ facility in El Segundo, the source added. Another source familiar with the situation stressed that Lakers president Jeanie Buss did not exert any influence in Scott’s future. Buss, who oversees the franchise’s business operations, deferred to Kupchak and her brother Jim Buss, the Lakers’ vice president of basketball operations. Nonetheless, Jeanie Buss has maintained she would make changes in the front office if the Lakers did not fulfill Jim Buss’ self-imposed timeline in which by next year the team would become a Western Conference contender.

Scott’s departure marks the third Lakers coach in the past four years that ended his time before his contract ended. The Lakers fired Mike Brown five games into his second season in 2012-13, while Mike D’Antoni resigned after two seasons in 2014.

Though the Lakers finished with a 17-65 record, the second worst in the NBA, they had sympathy for Scott amid the numerous challenges surrounding the 2015-16 season.

After facing season-ending injuries for three consecutive seasons, Kobe Bryant nursed nearly season-long soreness in his right shoulder. Although he played 66 games, Bryant averaged 17.6 points on a career-low 35.8 percent shooting and often did not know his playing status until just before tipoff.

The Lakers were also mindful of how they assembled their roster, which featured an intriguing core of young players and newly arrived veterans.

Rookie point guard D’Angelo Russell, second-year forward Julius Randle, second-year guard Jordan Clarkson, rookie forward Larry Nance Jr. and rookie forward Anthony Brown all represent the Lakers’ long-term future. Yet the Lakers also saw Russell and Randle, in particular, struggle with playing consistently. The Lakers liked the veteran presence from Roy Hibbert, Brandon Bass, Metta World Peace and Lou Williams, but none of those players made enough of an impact to change the bottom-line results.

“It’s not fair. He had a lot of pressure on him that didn’t really allow him to open up and coach,” Nance told the Southern California News Group about Scott. “Sometimes that’s how it goes, and the politics get the best of it. I feel for him — this was an impossible job.”

Nance added he was a “big fan” of Scott and thanked him for a heightened role after the Lakers selected him with the 27th pick out of the University of Wyoming. One Lakers player, who requested anonymity, was not as complimentary.

“Not shocked, honestly,” the player said. “But I think a fresh start could be good.”

During his introductory press conference two years ago, Scott vowed to revamp the team’s defense after former Lakers coach Mike D’Antoni oversaw a team that ranked 29th out of 30 NBA teams in points allowed (109.2) and 24th in defensive field goal percentage (46.8).

Yet the Lakers finished with similar numbers under Scott. In the 2014-15 season, the Lakers finished 29th in points allowed (105.3) and defensive field-goal percentage (46.6). Last season, the Lakers fared 26th in points allowed (106.9) and 29th in defensive field-goal percentage (47.3).

Scott also faced varying degrees of support and concern internally about how he handled the Lakers’ young players.

Some lauded Scott’s no-nonsense approach. He yanked the starting spots from Russell and Randle 20 games into the season amid frustration with both the team’s slow starts and their consistency. Scott rarely dialed back the intensity of his practices during the season. He never hesitated to critique them both privately and publicly.

Some found the approach counterproductive. They thought it inhibited the young players’ growth and confidence. Scott’s continuous support of Bryant and other veterans also sent mixed signals on both how he would hold all of his players accountable and divide up playing time.

Kupchak declined to offer any vote of confidence for Scott on Feb. 17, 2016. Instead, Kupchak only cited that Scott remained under contract. During his exit meeting on April 15, however, Kupchak added that the Lakers normally evaluate everyone, including coaches, after each season.

Kupchak also deferred to Scott on how he handled roles and praised him for his demanding expectations. Yet Kupchak conceded uncertainty about how that approach affected the Lakers’ young core.

Hence, one Lakers player, who requested anonymity, said he and other teammates believed the Lakers would retain Scott after watching Kupchak’s season-ending press conference. Still, Kupchak offered at least one signal about Scott’s possible departure.

“I know he’s hoping that he coaches here forever,” Kupchak said of Scott during his exit meeting. “But a lot of times, what we do is we’re really preparing for the next GM or the next coach, and that’s tough sometimes.