SANLIURFA, Turkey — Islamic State militants stormed into the Syrian Kurdish town of Kobani Thursday, launching suicide attacks and gunning down civilians five months after the extremists were driven from the area with the help of U.S.-led airstrikes.

Assailants in five cars penetrated Kurdish defenses shortly before dawn, carried out a suicide bombing and then fanned out in an apparent attempt to blast their way into the town on the Syrian-Turkish border, said Redur Xelil, a spokesman for the Kurdish People’s Protection Units, or YPG, which reclaimed Kobani in January.

The attackers — numbering about 30 — wore YPG uniforms and flew the flags of the opposition Free Syrian Army on their vehicles, Xelil said. They moved through the streets randomly shooting at civilians, killing and wounding scores, then detonating suicide vests as Kurdish forces closed in, according to Xelil and witnesses.

Authorities in neighboring Turkey said 63 civilians from Kobani were admitted to Turkish hospitals.

By nightfall, most of the militants had been captured, killed or surrounded, and Kurdish forces were reported to be restoring order. But the attack was a reminder of the Islamic State’s continued ability to upset the battlefield even when it appears to be on the defensive.

In recent weeks, the group has suffered defeats in nearby Raqqa province. The capture last week of the border town of Tal Abyad, the militants’ most important conduit for trade and the flow of foreign fighters, was followed by a Kurdish-Syrian rebel force’s advances farther south toward the city of Raqqa, the Islamic State’s self-proclaimed capital.

Xelil said the Islamic State’s attack on Kobani was intended to divert attention away from the group’s recent setbacks. The Islamic State is also known as ISIS, ISIL and Daesh.

“This is related to the success we achieved. Daesh wants to raise the spirits of its fighters, but I don’t think they can succeed,” he said.

One of the targets of the attack appeared to be the leader of the main Syrian rebel battalion fighting alongside the Kurds, according to Abu Shujaa, a spokesman for the battalion, Thuwar al-Raqqa, or Raqqa Revolutionaries. During the attack, Kurdish-speaking assailants in Kurdish uniforms went to the home of the leader, known as Abu Issa, asked for him and then opened fire, wounding six of his female relatives, Abu Shujaa said.

Kurdish fighters were still battling the militants late into the morning, Xelil said. Dozens of people, including women and children, have been killed or wounded, he added.

The assault represents the first major setback for Kurdish forces in Kobani since the Islamic State initially launched an offensive to capture the town in September, triggering the most intense airstrikes in the U.S.-led campaign against the group so far.

Kobani became a symbol of both Kurdish and American determination to confront the Islamic State, and U.S. officials regularly point to the victory there as an example of the progress that can be made when determined ground forces are backed by concerted U.S. air power.

The location of Thursday’s attack, on the northern edge of town adjoining the Turkish border, drew allegations of Turkish involvement from Kurdish activists. The Kurds have long accused Turkey of covertly helping the Islamic State to prevent them from consolidating control over territory adjoining the country. On its Facebook page, the YPG accused “the fascist Turkish army” of facilitating the attack, and on Twitter, the hashtag #TerroristTurkey trended worldwide.

Turkey strenuously denied the charge and released CCTV footage from its side of the border showing that the first suicide bomber drove his car from the Syrian side.

“By using the latest attack in Kobani as a pretext, some dirty circles are attempting to put Turkey on the target board,” Deputy Prime Minister Numan Kurtulmus said.

Turkish Foreign Ministry spokesman Tanju Bilgic said the government had evidence that the convoy of assailants was dispatched from the Islamic State-controlled Syrian town of Jarablus farther west, on the opposite bank of the Euphrates River. “We deny the allegation ISIS crossed the border from Turkey,” he said.

According to Abu Shujaa, all the assailants were Kurdish, many of them from Iraq, and they infiltrated Kobani by mingling with refugees returning to the destroyed town.

Xelil said the convoy of cars originally approached Kobani from the southwest, but he disputed the idea that the assailants could have come from Jarablus, saying bridges across the Euphrates have been blown up.

“Where they came from is a confusing question,” he said. “There are still ongoing investigations.”

Also Thursday, a coalition of mostly moderate rebel units launched an offensive to capture the southern Syrian city of Daraa from the government. If successful, the offensive would effectively leave President Bashar al-Assad’s increasingly beleaguered forces without a major foothold in southern Syria and further shift the balance of power.