He will now take up the role of football development executive at Eastlands.
"This role is a fantastic new challenge for me and I am very grateful to Manchester City for offering me this opportunity," Vieira told City's official website.
"I am confident that I can make a significant contribution to the club's ongoing success."
The Senegalese-born Frenchman was Roberto Mancini's first signing in January 2010 but started only 12 league games in 18 months at the club.
"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," he added.
Vieira first moved to the Premier League in 1996 with Arsenal and made 371 appearances for the London club.
During his time at Highbury Vieira won the Premier League on three occasions and the FA Cup four times, scoring the winning penalty against rivals Manchester United in the 2005 final.
Former manager Arsene Wenger said: "His career is sensational. He was an exceptional player for us.
"We have classy players in midfield now but Patrick was special. He was a tall player with good technique."
Vieira also won 107 caps for his country and was a member of the sides that won the 1998 World Cup and Euro 2000.