ISTANBUL — Two Islamic State militants who were plotting a suicide attack on the Turkish capital, Ankara, on New Year’s Eve have been detained, Turkish officials said Wednesday.

The two men were held after an early morning counterterrorism operation at a house in the Yakupabdal neighborhood of Ankara, according to the semiofficial Anadolu News Agency. Their identities and nationalities were not disclosed, but the Turkish news media reported that the men were of Turkish origin and had traveled to Syria.

They were planning attacks on the central Kizilay Square in Ankara, where large crowds gather annually to celebrate the New Year, a senior government official said.

The police raid uncovered one suicide vest, bomb-making equipment and ball bearings that could be used in an explosive device, according to a statement from the Ankara governor’s office. The police also seized a backpack full of materials to make explosives.