The suspects were apparently planning attacks dyring New Years Eve celebrations in the cities.
At least 25 people, including 15 foreign nationals, have been detained by the police on Sunday in Istanbul and Ankara for alleged links with the Islamic State (IS).
The anti-terrorist police officials raided a number of different locations in Istanbul's three districts after being tipped off about individuals linked to IS leaders in Syria and Iraq.
In another operation in Ankara, police arrested five IS suspects who were foreigners in simultaneous raids at two other locations in Etimesgut district.
Among the ones detained were three Syrians, an Iraqi and a Chechen who had entered the country illegally.
The suspects were apparently planning attacks during New Year's Eve celebrations in the cities.
This incident comes after Turkish security forces suspended over 2,700 personnel for having suspected links with the IS group.
More than 300 people have lost their lives in IS-claimed attacks in Turkey, where the terrorist organisation has targeted civilians in suicide bombings, and rocket and gun attacks.
At least 25 people, including 15 foreign nationals have been detained by the police on Sunday in Ankara for alleged links with the Islamic State