LONDON -- The deadly New Year's attack on a ritzy Istanbul nightclub has brought more turmoil to Turkey and shown how the conflict in neighbouring Syria easily can spill over to threaten Europe's stability.

The mass shooting's bleak coda came into sharp relief Monday: Islamic State militants claimed the "heroic soldier" who gunned down revelers with a high-powered rifle at the jam-packed Reina nightclub as one of their own as police tried to find the fugitive, who is believed to have escaped in the mayhem he caused.

The assault that happened in the second hour of 2017 bookended another holiday season terror in Europe -- the Dec. 19 attack at a Christmas market in Berlin. Both IS-linked assaults were carried out with the simple, low-tech approach that seems to be gaining favour with extremists.

In Berlin, a Tunisian extremist drove a large truck into the crowded market, killing 12. The Istanbul gunman killed a police officer and security guard outside the nightclub, then opened fire with an automatic rifle inside, leaving a total of 39 dead and dozens wounded.

This is the reality facing Europe as the Islamic State group loses territory in Syria and Iraq, but maintains followers, returning fighters and sleeper cells in the West eager to launch attacks.

POSSIBLE REASONS FOR THE ATTACK

The Islamic State group has many countries in its sights, and has claimed credit for high-profile attacks on France, Germany and Belgium while threatening Britain time and again. Turkey, which shares a large, porous border with Syria, is an appealing target because it is a NATO ally of the United States that has attacked IS positions in both Syria and Iraq.

For IS militants facing the loss of territory that comprises part of their self-proclaimed caliphate, carrying out successful attacks in other countries is an important reminder that the group still is a force to be reckoned with -- and feared. And it is relatively easy for IS sympathizers to infiltrate Turkey and to move around in densely populated urban areas.

The Reina nightclub might have been chosen because it is popular with an international clientele and well-to-do locals, including many from the worlds of entertainment and sports. It also serves alcohol, which is prohibited on IS-held territory. The Reina had a strong security detail, but the gunman opened fire on a policeman and a civilian outside the club and quickly gained entry.

Once inside, it was not difficult to claim many victims. But his ability to kill so many and still elude police is worrisome -- and has left Turkey on edge.

TURKEY'S VULNERABILITY

Turkey's location as a crossroads linking Europe and the Middle East has made it susceptible to rising tensions and rival factions throughout the region and brought in a huge number of migrants trying to get to western Europe.

Before the nightclub shootings, the country already had endured attacks from Islamic State militants and Kurdish separatists. There were dozens of substantial attacks last year alone as extremists tried to spread instability and damage the important tourist industry.

The list reads like a primer on modern terror tactics: a co-ordinated attack on the Istanbul airport in June that killed 44, a January suicide bombing that killed 12 German tourists, an August suicide attack on a Kurdish wedding party that killed at least 51 celebrants, and many others.

The cycle of violence, and a failed military coup in July that claimed about 270 lives, has led President Recep Tayyip Erdogan to take a more authoritarian approach. The government is also seeking to crack down on websites and social media users who praise extremist actions.

HOW CAN EUROPE PREVENT MORE ATTACKS?

Shifting extremist tactics have created new challenges for security agencies. Police and intelligence agencies say that "soft" public targets like nightclubs and sporting events are virtually impossible to comprehensively defend; there are too many of them. And as the Berlin, Istanbul and earlier attacks in France and Belgium brutally illustrated, a person with an automatic weapon or a heavy truck is armed with deadly force.

Extra layers of security, and some impregnable physical barriers, were added at some European landmarks for New Year's Eve celebrations to prevent a repeat of the Berlin attack, but it would not be possible to protect every popular club in every city and town.

The potential targets are plentiful and symbolic: In Berlin, a Christmas market long part of the city's festive tradition, in Istanbul, a New Year's party that represents Turkey's partial embrace of Western-style revelry.

The Berlin gunman escaped the scene and managed to cross into France and then Italy, where he was shot dead by police in a confrontation near Milan. In Istanbul, police say they have the gunman's fingerprints and a general description. Turkish officials said Tuesday they are close to being able to identify him, but where he remains at large is unknown.