NEW YORK -- Donnie Walsh's tenure as president and general manager of the New York Knicks came to an abrupt end Friday, with owner Jim Dolan announcing Walsh and the Knicks were parting ways, and with Walsh later saying he did not know if he had the energy to continue in the job for two more seasons.

"Following a long series of discussions regarding his future role with the New York Knicks, Donnie Walsh and I have mutually agreed that he will be leaving his position ... at the end of June," Dolan said in a statement.

Walsh will work in a consultant's capacity for the team next season.

"It took me a lot of energy the last three years to do this, and I'm running out of energy," Walsh said.

The stunning piece of news comes four weeks before Walsh's contract is due to expire, and after several weeks of face-to-face discussions between Walsh and Dolan. The team had imposed a news blackout around the discussions, and neither Walsh nor his agent had commented on his job status since the first round of the playoffs.

Walsh's departure opens questions about whether coach Mike D'Antoni will return for the final year of his contract, although Walsh said he spoke to D'Antoni and assured him he felt he was the best man to lead the team to the next level.

The Knicks had an April 30 deadline to pick up the fourth-year option on Walsh's contract, which he signed in 2008 following the troubled tenure of former team president and coach Isiah Thomas. But that date passed with no action being taken, and Walsh and Dolan were discussing a new contract that would keep him with the team at least through the 2012-13 season. Walsh's desire to have full autonomy was reportedly one of the sticking points, though he insisted it was more a matter of him questioning whether he'd have the energy to continue in the 24-7 mode required of a team president.

"I really did look into my soul, and I can't do this job at less than 100 percent, and I don't know that I could have committed to do this job for two years at 100 percent," Walsh said. "I've already given everything I've got up to this point, and I don't know how much more I've got left."

Walsh, 70, said there were no health concerns that led to his decision, and he would not rule out having a similar role for a different franchise sometime in the future.