The attack, condemned by the White House and the United Nations, was another sign of how Turkey, a NATO member and a partner in the U.S.-led campaign against the Islamic State group, is struggling to contain multiple security threats. The war in Syria has been a major problem for years, sending several million refugees into Turkey and, more recently, drawing in Turkish troops.