CAIRO/ISTANBUL (Reuters) - Islamic State claimed responsibility on Monday for a New Year’s Day mass shooting in a packed Istanbul nightclub that killed 39 people, an attack carried out by a lone gunman who remains at large.

It described the Reina nightclub, where many foreigners as well as Turks were killed, as a gathering point for Christians celebrating their “apostate holiday”. The attack, it said, was revenge for Turkish military involvement in Syria.

“The apostate Turkish government should know that the blood of Muslims shed with airplanes and artillery fire will, with God’s permission, ignite a fire in their own land,” the Islamic State declaration said.

At a news conference in Ankara, Turkish government spokesman Numan Kurtulmus made no reference to the claim but said it was clear Turkey’s military operations in Syria had annoyed terrorist groups and those behind them.

“This attack is a message to Turkey against its decisive operations across the border,” Kurtulmus said, adding that the offensive in Syria would continue until all threats to Turkey were removed.

The authorities are close to fully identifying the gunman, Kurtulmus said, after gathering fingerprints and information on his basic appearance, and had detained eight other people.

NATO member Turkey is part of the U.S.-led coalition against Islamic State and launched the incursion into neighboring Syria in August to drive the radical Sunni militants, as well as Kurdish militia fighters, away from its borders.

The jihadist group has been blamed for at least half a dozen attacks on civilian targets in Turkey over the past 18 months; but, other than assassinations, this is the first time it has directly claimed any of them. It made the statement on one of its Telegram channels, a method used after attacks elsewhere.

ATTACKER FROM CENTRAL ASIA?

Nationals of Saudi Arabia, Lebanon, Morocco, Libya, Israel, India, Canada, a Turkish-Belgian dual citizen and a Franco-Tunisian woman were among those killed at the nightclub on the shores of the Bosphorus waterway. Twenty-five of the dead were foreigners, according to the state-run Anadolu news agency.

All of those killed died from gunshot wounds, some of them shot at a very close distance or even point-blank range, according to a forensics report quoted by Milliyet newspaper.

Police distributed a hazy black-and-white photo of the alleged gunman taken from security footage.

The authorities believe the attacker may be from a Central Asian nation and suspect he had links to Islamic State, the Hurriyet newspaper said. It said he may be from the same cell responsible for a gun-and-bomb attack on Istanbul’s main airport in June, in which 45 people were killed and hundreds wounded.

Slideshow ( 14 images )

The attack at Reina, popular with Turkish celebrities and wealthy visitors, shook Turkey as it tries to recover from a failed July coup and a series of deadly bombings, some blamed on Islamic State, others claimed by Kurdish militants.

Around 600 people were thought to be inside when the gunman shot dead a policeman and civilian at the door, forcing his way in then opening fire with an automatic assault rifle. Witnesses said he shouted “Allahu Akbar” (God is Greatest).

Some at the exclusive club jumped into the Bosphorus after the attacker opened fire at random just over an hour into the new year. Witnesses described how he shot the wounded as they lay on the ground.

Slideshow ( 14 images )

KALASHNIKOV IN SUITCASE

The attacker was believed to have taken a taxi from the southern Zeytinburnu district of Istanbul and, because of the busy traffic, got out and walked the last four minutes to the entrance of the nightclub, newspaper Haberturk said.

He pulled his Kalashnikov rifle from a suitcase at the side of the road, opened fire on those at the door, then threw two hand grenades after entering, Haberturk said, without citing its sources. It said six empty magazines were found at the scene and that he was estimated to have fired at least 180 bullets.

Security services had been on alert across Europe for new year celebrations following an attack on a Christmas market in Berlin that killed 12 people. Only days ago, an online message from a pro-Islamic State group called for attacks by “lone wolves” on “celebrations, gatherings and clubs”.

In a statement hours after the shooting, President Tayyip Erdogan said such attacks aimed to create chaos and destabilize the country.

Four months into its operation in Syria, the Turkish army and the rebels it backs are besieging the Islamic State-held town of al-Bab. Erdogan has said he wants them to continue to Raqqa, the jihadists’ Syrian stronghold.

Turkey has also been cracking down on Islamic State networks at home. In counter-terrorism operations between Dec 26-Jan 2, Turkish police detained 147 people over links to the group and formally arrested 25 of them, the interior ministry said.

The New Year’s Day attack came five months after a failed military coup, in which more than 240 people were killed, many of them in Istanbul, as rogue soldiers commandeered tanks and fighter jets in a bid to seize power.

More than 100,000 people, including soldiers and police officers, have been sacked or suspended in a subsequent crackdown ordered by Erdogan, raising concern both about civic rights and the effectiveness of Turkey’s security apparatus.

The government says the purges will make the military, police and other institutions more disciplined and effective.