ANKARA (Reuters) - Turkish police have detained 29 suspected Islamic State militants in Istanbul, 22 of them foreign nationals, believed to be preparing to travel to Syria, the state-run Anadolu news agency said on Friday.

Anti-terrorism police carried out operations at 20 separate addresses in six city districts overnight, Anadolu said, adding that one unlicensed weapon and documents belonging to the jihadist group were found in the raids.

Thousands of foreign fighters have joined the Islamist militants in their self-proclaimed caliphate in Syria and Iraq in recent years, many of them passing through Turkey.

Ankara has detained more than 5,000 Islamic State suspects and deported some 3,290 foreign militants from 95 different countries in recent years, according to Turkish officials. It has also refused entry to at least 38,269 individuals.

On Wednesday, Turkish police detained six suspected Islamic State militants for planning to attack a protest march led by the head of the secularist main opposition party.

In a separate operation on Wednesday, Turkish police detained another 37 Islamic State suspects across Turkey, authorities said.