“Jeff is a true professional who has worked tirelessly for this organization the last two seasons,” Knicks president Steve Mills and general manager Scott Perry said in a statement. “We sincerely appreciate his efforts and considerable contributions to the team and wish him well in his future endeavors.”

Hornacek went 60-104 and had a year left on his contract. He became the first coaching change after the NBA regular season finished, sending the Knicks in search of their 11th different head coach since Jeff Van Gundy resigned in the 2001-02 season.

Hornacek was hired in 2016 by Phil Jackson and lasted just one more season after Jackson and the team parted ways last summer. Mills and Perry apparently weren’t pleased with the results, though they knew the Knicks were rebuilding with younger players.

“Jeff is a good guy,” forward Michael Beasley said after Wednesday’s victory. “He played the hand he was dealt. It’s difficult to do anything because all you’re thinking about is not to mess up.”

The Knicks have won only one postseason series since 2002 and didn’t get close to competing in one under Hornacek, running their streak to five straight 50-loss debacles.

Hornacek, previously a head coach for three years in Phoenix, himself was even surprised when he became Jackson’s choice, since they had little relationship other than facing off in the NBA Finals when Hornacek played for Utah against the Jackson’s Chicago Bulls.

Jackson said Hornacek would be allowed to run whatever offense he wanted and not required to implement the triangle Jackson used as a coach. But he shifted gears during Hornacek’s first season, and the team returned to the triangle with poor results.

Hornacek opened up the offense after Jackson’s departure, and the Knicks started surprisingly well this season. But they tailed off toward the middle of the season and then completely collapsed late after All-Star Kristaps Porzingis tore his ACL on Feb. 6.

Hornacek said he was prepared for the chaos that comes with the Knicks job and he experienced plenty of it, from Jackson’s feud with Carmelo Anthony, who was eventually traded in September, to his own clash during this season with Joakim Noah, who then remained on the roster but never returned to the team.

With Anthony, Noah and Derrick Rose all gone, the Knicks lacked the veteran roster this season they had when Hornacek was hired with playoff expectations.

They didn’t get there this season — though briefly thought they had hopes after starting 16-13 — and Hornacek tried to preach patience late in the season as the losses piled up with a young roster that defended dismally.

Hornacek is 161-216 and has never reached the postseason as an NBA coach.

Rambis, a former assistant under Jackson, originally came to New York to work under Derek Fisher and served as interim head coach for half a season after Fisher was fired. He then remained on the staff under Hornacek.