Ryan Giggs is to leave Manchester United after 29 years to pursue his managerial ambitions, the Premier League club have announced.
Giggs, who made a record 963 appearances for the Red Devils, had one more year on his contract as assistant manager but new boss Jose Mourinho is expected to give that role to Rui Faria.
The Old Trafford club had hoped Giggs could be persuaded to stay on in a different role but the 42-year-old Welshman has decided to move on.
A club statement read: "Ryan Giggs is to leave Manchester United, the club he has been with since the age of 14, to pursue his desire to be a manager."
The Cardiff-born Giggs has spent the last two seasons as Louis van Gaal's assistant, having served a short stint as caretaker manager after David Moyes' departure at the end of the 2013-14 campaign.
Prior to that, he was a fixture in United's first team for 23 years, scoring 168 goals in all competitions and winning 13 Premier League titles, four FA Cups, three League Cups and the Champions League twice.
In total he won 34 trophies during his playing days, making him the most decorated player in United's history.
But the fans' favourite has never hidden his desire to progress as a manager and he is widely believed to have been disappointed that he was overlooked for the top job.
Giggs said in a statement on www.manutd.com: "After 29 seasons at Manchester United as a player and assistant manager, I know winning is in the DNA of this club - giving youth a chance, and playing attacking and exciting football.
"It's healthy to have high expectations, it's right to expect to win. Manchester United expects, deserves, nothing less.
"This is why it is a huge decision for me to step away from the club that has been my life since the age of 14.
"It has not been a decision that I have made lightly. I'll take away so many special memories as well as a lifetime of experiences that will, I hope, serve me well in the future."
Having completed his coaching badges, Giggs was linked with Swansea City last season and Nottingham Forest this summer, although that post has now been filled by Frenchman Philippe Montanier.
Giggs, who played 64 times for Wales and was the first man to win back-to-back PFA Young Player of the Year awards (1992 and 1993), has most recently been seen as a television pundit during Euro 2016 but has given few clues as to what he will do next.
Manchester United has confirmed Ryan Giggs will leave the club. Here is his career at Old Trafford in pictures. https://t.co/l0xZjgyXx0— SkyNews (@SkyNews) July 2, 2016
He said: "The time feels right (to leave United) and, although I have no immediate plans to step into management, it is where I want to be.
"I've been extremely fortunate in having two great managerial mentors; first in Sir Alex (Ferguson), who I've spent the majority of my life working with and learning from and who I believe will remain as football's greatest-ever manager and in more recent times, Louis van Gaal, whose CV speaks for itself.
"The knowledge I have gleaned from them has been invaluable.
"It's time for a new chapter and a new challenge. I'm excited about the future - I've had the best apprenticeship into management anyone could ever ask for."
On the impending arrival of Mourinho, who reports to United's training ground at Carrington for the first time on Monday, Giggs added: "I want to congratulate Jose Mourinho on his appointment as manager of the world's biggest club.
"There are only a handful of proven winners at the very highest level and Jose is unquestionably one of them. I know the fans will welcome him."
United executive vice-chairman Ed Woodward said Giggs will be missed at Old Trafford and believes he has what it takes to become a "terrific" manager.
He said: "Ryan's place in the history of Manchester United is assured. He has been a constant presence at the club since 1987 and, during his playing days, regularly delighted crowds; first with his dazzling wing play and later with his intelligence and ability to dictate a game.
"The experiences and discipline he developed at United will undoubtedly be a big help as he continues to learn his trade.
"He has all the attributes to be a terrific manager in the future. Everyone at the club wishes him well in his new career.
"He will be missed but will always be welcome at Manchester United."