Although he battled back to make a further 33 appearances for the club, Wes Brown, John O'Shea and Rafael provided stiff competition for him at right-back.
He stepped down as team captain in September 2010, although he continued to fulfil that role off the pitch.
Announcing his retirement with immediate effect, he said: "I have played in the most incredible football teams, playing with some of the best players in the world as well as against them and I have been lucky to be a part of the team's achievements and the club's great success.
"There are so many people I want to thank and of course top of that list is Sir Alex Ferguson.
"He has given me so many opportunities and countless support over the last 20 years. He is truly one of the greatest managers and I have to thank him for that.
NEVILLE'S MAN UNITED HIGHLIGHTS
1991: Signs as apprentice for club
1992: Debut in Uefa Cup game against Torpedo Moscow
1995: Plays in FA Cup final loss to Everton
1996: Member of United's double winning squad
1997: First club goal in 3-3 draw with Middlesbrough
1999: Member of United's treble-winning squad
2000: Wins fourth championship medal and makes 250th club appearance
2003: Collects sixth Premiership winners medal
2004: Third FA Cup winners medal and signs new four-year contract
2005: Named club captain
2010: Wins second League Cup
"There have also been so many great players that I have had the privilege to train and play alongside. The experiences we've shared will be with me for the rest of my life."
He added: "I am looking forward to new experiences and the club will always be a part of my life going forward.
"However, the most important thing now is for the club to continue with the success that is synonymous with Manchester United and I will be supporting them all the way, as a fan."
Man Utd manager Sir Alex Ferguson said: "Gary was the best English right-back of his generation.
"He is an example to any young professional; hard-working, loyal and intelligent. As a United fan born and bred, his fantastic career at Old Trafford has cemented his place in the affection of the club's supporters everywhere."
Neville has been linked with a move into television punditry, while he is also considered a candidate to go into the coaching side of the game.
NEVILLE'S ENGLAND CAREER
June 1995: Makes England debut in Umbro tournament at Wembley
1996: Member of England's Euro 96 squad, but misses semi-final exit to Germany
1998: Regular in Glen Hoddle's World Cup squad
2002: Wins 50th England cap in 1-1 draw with Holland but misses World Cup with an injury
2006: Ever present in World Cup squad
February 2008: Plays last full game for England in 1-0 defeat by Spain
May 2009: Surprise international recall by Fabio Capello for World Cup qualifiers but does not play
"Gary has been a great servant to the club and we thank him for his loyalty and his contribution to the tremendous success we have enjoyed in his playing time here," said United chief executive David Gill.
"I know from my many dealings with him over the years he always had the club's best interests at heart.
"So whilst this illustrious chapter in his career has finished, his experience, commitment and energy will ensure he will continue to play a part in the life of the club, whether on the coaching or the commercial side."
Team-mate Rio Ferdinand wrote on Twitter: "The best right-back in Premier League history, fact. Gonna be a big loss to our dressing room.
Watch Neville playing for England in 1998 World Cup
"Nev is loyal, funny, dedicated and talented....a true Man Utd legend. Gave his all for the club he supported and won a load of medals."
And former team-mate Steve Bruce told BBC Radio 5 live: "He had a wonderful hunger and desire to succeed, which kept him where he was in the game... a Manchester United icon."
Neville has been touted as a potential reserve-team coach at United, replacing Ole Gunnar Solskjaer, who has returned to Norway to take charge at Molde.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.