NEW YORK -- Phil Jackson wanted to trade Carmelo Anthony and wouldn't rule out dealing Kristaps Porzingis.

Turns out, Jackson is the one leaving.

Jackson is out as New York Knicks president after he oversaw one of the worst eras in team history, with the team saying in a statement Wednesday that they had "mutually agreed to part company."

Days after Jackson reiterated his desire to move Anthony and said he would listen to deals for Porzingis, Madison Square Garden chairman James Dolan reversed course and cut ties with Jackson with two years remaining on his contract.

"After careful thought and consideration, we mutually agreed that the Knicks will be going in a different direction," Dolan said. "Phil Jackson is one of the most celebrated and successful individuals in the history of the NBA. His legacy in the game of basketball is unmatched."

But his work as a first-time executive was awful. The winner of an NBA-record 11 championships as coach, Jackson couldn't engineer one playoff berth while running the Knicks. The team was 80-166 in his three full seasons, including a franchise-worst 17-65 in 2014-15.

His departure was quickly welcomed by Knicks fans such as film director Spike Lee, who posted a picture of himself on Instagram in a celebratory pose after it was first reported by The Vertical.

The move comes less than a week after Jackson led the Knicks through the NBA draft and on the eve of free agency that opens Saturday. Dolan said he would not be involved in the operation of the team, adding that general manager Steve Mills would run the day-to-day business in the short term and that former Toronto executive Tim Leiweke would advise him and help develop a plan going forward.

Jackson was a Hall of Fame coach with the Chicago Bulls and Los Angeles Lakers, delivering titles with some of the game's biggest stars like Michael Jordan, Shaquille O'Neal and Kobe Bryant. He also played for the Knicks when they won NBA titles in 1970 and 1973.

He was welcomed back to the organization with a $60 million contract to huge fanfare in March 2014, but it soon became clear the transition would be a poor one. His first coaching hire, Derek Fisher, lasted just 1 1/2 seasons, and Jackson's trades and free agency moves also failed to improve the club.

"I had hoped, of course, to bring another NBA championship to the Garden. As someone who treasures winning, I am deeply disappointed that we weren't able to do that," Jackson said. "New York fans deserve nothing less. I wish them and the Knicks organization all the best -- today and always."

The turbulence he created off the court may have led to his departure more than the Knicks' record on it.

Jackson publicly talked about moving without Anthony -- angering the National Basketball Players Association -- though the All-Star forward has two years left on the five-year, $124 million deal that Jackson gave him shortly after taking the job. Anthony has a no-trade clause and has said he wants to stay in New York, and the stalemate that hung over the team for much of last season threatened to linger throughout the summer.

Then Jackson said before the draft that he was listening to offers for Porzingis, the 21-year-old forward from Latvia whom he drafted with the No. 4 pick in 2015 in one of his few successful moves.

Coach Jeff Hornacek, in Orlando with the Knicks' team preparing for summer league, thanked Jackson for bringing him to New York last summer.

"It's a tough day for us but our group, really our focus is to get this team better, continue to build our young players and figure out a way to win," Hornacek said. "We have a lot of time before the regular season and we will figure that out."

Jackson believed the Knicks would compete for a playoff berth last season after he traded for Derrick Rose, signed Joakim Noah and Courtney Lee and hired Hornacek. But after a solid start, they quickly spiraled toward their familiar position at the bottom of the Eastern Conference and finished 31-51.

Despite all that, Dolan said during an ESPN Radio interview in February that he would allow Jackson to finish his contract, and the sides picked up the mutual two-year option on Jackson's contract.

But the instability involving Anthony and Porzingis threatened to damage the team's ability to lure free agents and may have spurred Dolan's decision. Though he had been intent on keeping Jackson, the dysfunction within the franchise showed no sign of ending even as Jackson, 71, largely stayed out of sight.

He never spoke to the media last season after vowing openness upon taking the job and refused to provide Anthony with the communication he sought.

"It's like a total train wreck ," tennis great and Knicks fan John McEnroe told The Associated Press last week.

"I mean, he's known as the Zen Master, like a master talker, and then he's not talking to anybody," McEnroe said of Jackson. "So this whole thing seems to have gone completely off the rails."

There was also incessant debate about Jackson's insistence that the team employ the triangle offence, which potential incoming players were schooled on during the run-up to last week's draft. The Knicks wound up taking 18-year-old French point guard Frank Ntilikina, who spoke highly of the triangle and Jackson's belief in the scheme.

"I think I can definitely fit with this system," Ntilikina said on draft night.

Not even a week later, the triangle is probably gone, and the Knicks will start anew.

Rose, the 2011 NBA MVP, will be a free agent. Noah -- whom Jackson gave a puzzling four-year, $72 million contract last summer -- will start the season by finishing out a 20-game suspension for violating the league's anti-drug policy. He averaged 5.0 points and 8.8 rebounds in his first season in New York, shooting just 44 per cent from the foul line.

AP Basketball Writer Tim Reynolds in Miami and Associated Press Writer Terrance Harris in Orlando, Florida, contributed to this report