Turkish President Tayyip Erdogan said on Wednesday that linking lifestyle differences with the attack at an Istanbul nightclub on New Year's Day was a deliberate attempt to divide the nation and that the state never meddled in how people lived.

"There is no point trying to blame the Ortakoy attack on differences in lifestyles," Erdogan said in a speech to local administrators at the presidential palace in Ankara.

"Nobody's lifestyle is under systematic threat in Turkey. We will never allow this," he said, in comments broadcast live.

The mass shooting on Sunday killed 39 people and was claimed by Islamic State. Turkey's Religious Affairs Directorate, which condemned the attack, had issued a statement in December saying celebrating the New Year did not fit with Muslim values, triggering criticism from some parts of Turkish society.