The 35-year-old Frenchman, who was released by City at the end of last season, has accepted the position of football development executive and will help in the development of young players among other responsibilities.
End of the road: Vieira, who enjoyed a trophy laden career at Arsenal has retired from professional football
Vieira said: 'It was something I was preparing for in my head and I think it was the right time.
'It's a sad day and a sad moment but overall I've enjoyed the years I've spent in football. Football has brought me a lot.
'I think it will be difficult to find a job that will give me as much satisfaction as football has given me but I just want to give back to society and give back to football what it has given to me. And what a fantastic club for me to do it.
'This role is a fantastic new challenge for me and I am very grateful to Manchester City for offering me this opportunity.
'I have a lot to learn about the non-playing areas of the business but there are many very experienced people here for me to learn from and I am confident that I can make a significant contribution to the club's ongoing success.'
Vieira was City boss Roberto Mancini's first signing when he left Inter Milan to return to the Barclays Premier League in January 2010.
Waving goodbye: The former France international has retired from football with immediate effect
He was not a regular starter but made 47 appearances in total, scoring six goals, with his final run-out in a City shirt coming as a late substitute in the FA Cup final victory over Stoke in May.
And Vieira says he was proud to be part of the team that won the first piece of silverware in the blue half of Manchester for 35 years and has tipped his former club to win more trophies in the coming seasons.
'I was really proud to be part of the team last year and I think the team responded really well to the expectation,' he added. 'The future is looking fantastic because talent has come in and the team is really hungry to win silverware.'
In his new role, as well as working in the youth set-up, Vieira will also help to deliver the club's social responsibility programme and get involved on the commercial side.
The Frenchman added: 'I am particularly pleased to be given the opportunity to work with the club's community scheme.
'Manchester City has a great reputation for its commitment to its community and charity partners and Ibelieve I can help to take that message to an even greater audience.
Invincible: Vieira skippered the Arsenal side which went an entire Premier League campaign unbeaten in 2003/04
'Everyone at Manchester City - the fans, the staff and the players - have made me and my family feel very welcome here over the past two years and I am very happy to have been given the chance to stay and develop my career away from the pitch.'
Vieira rose to prominence when he joined Arsenal from AC Milan in 1996 and he went on to enjoy great success in nine seasons with the Gunners.
The combative midfielder won three Premier League titles and was part of the 'Invincibles' team that did not lose a match in the 2003-04 season.
Hebecame club captain following Tony Adam's retirement in 2002 and also won four FA Cups, including the penalty shoot-out triumph over Manchester United in 2005 that remains Arsenal's last trophy.
Vieirawas, however, a controversial figure who collected cards to go with hismedals and he was sent off 10 times in Arsenal colours.
He left the Gunners to join Juventus and won the Serie A title in 2006, although the Turin side were then stripped of the trophy amid the Serie A match-fixing scandal and the Frenchman moved on again to Inter Milan.
Getting shirty: Vieira joined Manchester City in January 2010
In a hugely successful spell, Inter won the league for four successive years but Vieira found himself increasingly troubled by injuries and departed for Manchester before theItalians' Champions League triumph in 2010.
On the international stage, the Frenchman was a key part of the team that won the European Championships in 2000 and also made a substitute appearance in France's World Cup final triumph over Brazil two years earlier.
Vieira will report to City's chief football operations officer Brian Marwood, who described him as the 'ultimate professional'.
Marwood said: 'His experience in the world of football is virtually unparalleled and he will be a huge asset to our club as old and young alike benefit from his knowledge.
'Hiscontribution to world football during his time as a player was extraordinary and he will be remembered as one of the greatest players to grace the Premier League.
'Whilstit is sad to see Patrick's playing career come to an end, we are delighted that he has chosen to extend his time with Manchester City in this new capacity.
Head boy: The midfielder made 47 appearances for City during the twilight of his career
'Wherever he goes he commands the respect of his audience and we believe he will make an invaluable contribution to our club as we build on our recent successes.'
Arsenal manager Arsene Wenger led the acclaim for Vieira.
Wenger described his fellow Frenchmanas a 'special' player and pledged Arsenal would always remember his contribution to one of the club's most successful eras.
Vieira joined Arsenal from AC Milan in 1996 and was a key component of the teams which won the Premier League and FA Cup double in 1998 and 2002, before as captain he guided the team which became known as the 'Invincibles' to another title in 2004.
Arsenal did not lose a league match that season, and in 2005 they won the FA Cup when Vieira scored the winning spot-kick in a penalty shoot-out against Manchester City.
He left after that match, having spells with Juventus, Inter Milan and most recently City, where at the age of 35 he has agreed to take up a role as football development executive.
Perfect sign-off: Vieria scored the winning penalty in the 2005 FA Cup final shoot-out - he left to join Juventus the following summer
Arsenal have not been the same force since his departure, failing to win a trophy and struggling to keep pace with the likes of Manchester United, Chelsea and latterly Manchester City.
Wenger said: 'You can only have lot of respect for what Patrick has achieved. His career is sensational. He was an exceptional player for us.'
It was Wenger who urged Arsenal to sign Vieira, shortly before taking charge at Highbury, and he told today how the dynamic Senegal-born player stood out.
'We have classy players in midfield now but Patrick was special. He was a tall player with good technique,' Wenger said on arsenal.com.
Wenger stressed he would not wish to compare Vieira, who made 406 appearances for Arsenal, with his current crop of players.
'We have exceptional players in midfield with their own character,' Wenger said. 'But at Arsenal we will be forever grateful for Patrick's contribution.'
Manchester City 2 Arsenal 0: Vieira snubs former club to take up coaching role at Eastlands Mr Agent: Inside the world of transfers with Sportsmail's expertMartin Keown: Arsenal boss Arsene Wenger must rediscover his Midas TouchVieira keen to stay and finish his career at Manchester City