The New York Knicks parted ways with embattled president of basketball operations Phil Jackson on Wednesday morning.

Owner James Dolan had been weighing Jackson’s future role running the franchise despite the two years and $24 million-plus left on his contract, league sources told The Vertical.

Dolan is targeting Toronto president of basketball operations Masai Ujiri to replace Jackson, league sources told The Vertical.

Ujiri signed a five-year, $30 million-plus extension a year ago, and it’s unclear how easily he could be pried from Toronto – if Ujiri has interest in the job.

Toronto lost its general manager, Jeff Weltman, to the Orlando Magic recently. The Raptors are expected to promote assistant GM Bobby Webster to replace Weltman in the Raptors’ front office, league sources said.

Dolan became increasingly intrigued with Ujiri primarily through two past deals with New York – trading Carmelo Anthony from Denver, and Andrea Bargnani from Toronto – in which Ujiri received substantial returns, league sources said.

The future of Knicks general manager Steve Mills is unclear, but he could transition the franchise through free agency, which begins Saturday.

Phil Jackson admitted to fielding trades for Kristaps Porzingis. (AP) More

Dolan had been harboring uncertainties about how much longer to commit to Jackson, 71, as the organization’s top basketball decision-maker, league sources told The Vertical.

Dolan had become increasingly concerned about Jackson’s fitness for the job and the long-term prospects of success for the franchise, especially in the aftermath of Jackson entertaining trades for Kristaps Porzingis, the franchise’s 21-year-old burgeoning star, league sources told The Vertical.

While Jackson has $24 million left on his original five-year contract, Dolan has a history of paying off long-term financial commitments without much consternation.

Jackson struggled to make progress with the Knicks, including a three-year record of 80-166 since he took over the role. His insistence on running the triangle offense alienated players and turned off potential free agents, and Jackson struggled to connect with the two head coaches that he hired: Derek Fisher and current coach Jeff Hornacek.

Jackson’s public battles with the Knicks’ two highest-profile players, Anthony and Porzingis, have been part of the marring of Jackson’s run with the Knicks, too.

Jackson was hired three years ago after a historic coaching career that included 11 NBA titles, a prodigal Knicks son returning to restore the organization to relevance. Jackson has struggled to adapt to the modern duties of an NBA executive, making mistakes largely in free agency and trades that have set back the organization.

More NBA coverage from The Vertical: