Roy Keane has left Manchester United by mutual consent.
United confirmed on Friday that Keane, 34, had left with immediate effect, bringing to a sudden end his 12-and-a-half years at Old Trafford.
Keane had said he was not expecting to get a new contract, with his current deal up at the end of the season.
But he criticised the side last month in an interview to MUTV, which was never shown, and that appears to have brought forward his departure.
Keane's outburst on MUTV, which is the club's own television station, came after a 4-1 defeat to Middlesbrough in which he did not feature because he broke his foot in a 0-0 draw against Liverpool on 18 September.
That game at Anfield now becomes his last game for United.
Keane's representative Michael Kennedy met United chief executive David Gill at Old Trafford on Friday to thrash out details of Keane's severance, and the stunning news was then announced.
Amazingly, Keane trained with United on Friday morning.
And, during manager Sir Alex Ferguson's weekly media conference which came before the announcement, the Scot said his captain was training well and was "not far away" from a full recovery from injury.
Following the announcement Keane, manager Sir Alex Ferguson and Gill all made statements of their own, with none of them mentioning any behind-the-scenes problems between the player and his club.
Keane said: "It has been a great honour and privilege for me to play for Manchester United for over 12 years.
"During my time at the club I have been fortunate to play alongside some of the best players in the game and in front of the best supporters in the world.
"At all times I have endeavoured to do my best for the management and the team.
"Whilst it is a sad day for me to leave such a great club and manager I believe that the time has now come for me to move on. After so many years, I will miss everyone at the club.
"I send my best wishes for the future to the management, players, staff and supporters of the club."
Ferguson said: "Roy Keane has been a fantastic servant for Manchester United.
"The best midfield player in the world of his generation, he is already one of the great figures in our club's illustrious history.
"Roy has been central to the success of the club in the last 12-and-a-half years and everyone at Old Trafford wishes him well in the rest of his career and beyond."
Gill said: "Roy has been a towering figure at the club for over a decade. His dedication, talent and leadership have been qualities that have marked him out as one of the true greats.
"On behalf of everyone at the club, we wish him every success in his future career."
United's full statement read: "Manchester United has today reached agreement with Roy Keane for Roy to leave the club with immediate effect.
"The agreement allows Roy to sign a long term deal with another club to enable him to secure his playing career beyond what would have been the end of his contract at United in the summer.
"The club has offered Roy a testimonial in recognition of his 12-and-a-half years at Old Trafford.
"The club thanks Roy for his major contribution to the club during his years of service."
KEANE'S OLD TRAFFORD CAREER
1993: Joins Man Utd for a then British record transfer fee of £3.75m
1994: Helps United win league and FA Cup Double
1996: Wins second league and FA Cup Double
1997: Helps United retain league title
1999: Captains United during treble-winning season but misses out on European Cup final win through suspension
2000: Leads Utd to another league title
2003: Leads United to their eighth Premier League title
2004: Lifts fourth FA Cup title in win over Millwall, setting a record with his sixth appearance in Final
2005: Leaves Utd by mutual consent
Total appearances: 479
Total goals: 51
League appearances: 326
League goals: 33
Premiership: 1994, 1996, 1997, 1999, 2000, 2001, 2003
FA Cup: 1994, 1996, 1999, 2004
Champions League: 1999
Intercontinental Cup: 1999
PFA Player of the Year: 2000
Football Writers' Player of the Year: 2000
The specific mention in that statement of Keane's availability appears to suggest he will sign for another club, rather than retire.
That could alert Celtic, a club Keane has consistently been linked to but whose manager Gordon Strachan said earlier this season he would not discuss Keane while he was under contract elsewhere.
However, Keane is also thought to be high on the Republic of Ireland's wish-list to fill their vacant manager's role, after they saw the success Mark Hughes had when he cut his coaching teeth with Wales.
Keane won 66 caps for Ireland but retired from playing at international level last month. The FAI refused to make any comment on Keane's exit from United when contacted by BBC Sport on Friday.
Keane and Ferguson were once famously close, with the Irishman seen as his boss' spokesman on the pitch.
But the pair began to drift apart following a row at the club's pre-season training camp in Portugal last July.
That disagreement was believed to be about the quality of the set-up in Portugal and the fact that players' wives were allowed to attend.
It was also not the first time he has fallen out with a manager over a training camp - Keane famously stormed out of the 2002 World Cup because he was angered by then-manager Mick McCarthy's preparations.
He vowed then to never play for his country again while McCarthy was in charge, and duly stayed in the cold until Brian Kerr took the helm for the Republic.