Speculation that Nasri could join Turkish outfit gathered pace at the weekend when the attacker was spotted boarding a flight to the country.
The move has now been announced by City, although the deal is subject to international clearance.
"Everybody at the club wishes Samir good luck in the next chapter of his career and would like to thank him for some fantastic memories," read a statement on Man City's official website.
The player, whose deal at the Etihad was due to expire in the summer of 2019, spent last season on loan at Sevilla after being deemed surplus to requirements by incoming manager Pep Guardiola.
Nasri leaves City having scored 26 times in 171 appearances since a 2011 move from Arsenal.