The 34-year-old Algerian has scored 11 goals in 78 games for City but has decided to call it a day.
This is a decision I have thought about very carefully," he told the club's official site.
"My aim when I joined the club was always to help the team gain promotion, and then to become established in the Premiership.
"I also wanted to finish my career on a high, knowing that I have played my best and done justice to myself and the team.
"I cannot think of a better club at which to finish my competitive career, and my thanks go out to the Manchester City fans, who quite honestly have been the most amazing I have ever played for."