It said the two men killed were believed to be planning an attack and police seized guns and grenades in the apartment in an operation launched after a tip-off from a suspect detained in Istanbul.
The raid occurred ahead of the ruling AK Party's congress in the city on Sunday, when it was expected to elect President Tayyip Erdogan as leader after constitutional reforms approved last month in a referendum granting him sweeping new powers.
Ankara's Governor Ercan Topaca told Anadolu at the scene of the raid that the detained suspect, an Azeri citizen, was still being questioned in Istanbul and was believed to have brought the two men to Ankara by car, Anadolu said.
NATO member Turkey is part of the U.S.-led coalition against Islamic State and launched an incursion into Syria last August to drive the jihadist group and Kurdish militia fighters away from its borders.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)