ISTANBUL — The wedding on Saturday night was winding down, and some guests had already left. But the music was still playing and people were still dancing in the narrow streets of Gaziantep, a city not far from the Syrian border.

Just then a child — no more than 14 years old, Turkey’s president said later — meandered into the gathering and detonated a vest of explosives.

Suddenly, the most joyous of occasions became a scene of blood and gore, with body parts scattered all around. Once again, the horrors of Syria’s civil war had visited Turkey.