ISTANBUL — When a lone gunman murdered dozens of New Year’s revelers early Sunday, he targeted a symbol of a cosmopolitan Istanbul that is increasingly under threat: a dazzling nightclub where people from around the world could party together, free from the mayhem and violence gripping the region.

It was there, at the Reina nightclub on the Bosporus — a hot spot for soap opera stars and professional athletes, Turks and well-heeled tourists — that those hoping to move past a particularly troubled year died together.

The assault was the second in two weeks in Turkey, and it further exposed the fault lines in a country that is increasingly tearing apart amid terrorist attacks and political instability.

With the gunman still on the loose Sunday night and a nationwide manhunt underway, the killings brutally highlighted a dilemma for Turkey’s authoritarian president, Recep Tayyip Erdogan: Even though he has cracked down on opponents and put in place security measures to bring stability to his rattled country, the attacks keep mounting.