BEIRUT — Islamic State militants staged a surprise attack early Tuesday at a crossing frequently used by Iraqi and Syrian civilians seeking safety in northeastern Syria, killing at least 37 people, mostly civilians, Kurdish officials and activists said.

The pre-dawn attack took place after militants sneaked into the village of Rajm Sleibi, located along a front line that separates the Kurdish-controlled Hassakeh province from ISIS-held areas further south. Some militants reportedly blew themselves up at a Kurdish checkpoint while others attacked sleeping civilians in a nearby temporary camp sheltering hundreds of displaced people who fled ISIS-controlled territory.

The International Rescue Committee said thousands of people from the Iraqi city of Mosul have traveled west to the Sleibi crossing since October, often via smugglers. In a statement, it said several children were among the dead and wounded.

"We are appalled and saddened to hear of the attacks," said Thomas Garofalo, regional advocacy adviser at the IRC.

Redur Khalil, a spokesman for the main Kurdish fighting force in Syria, said the attack started with an early morning assault by ISIS militants on a checkpoint in Sleibi belonging to the Syrian Democratic Forces, a U.S.-backed and Kurdish-dominated force that fights the Islamic State.

The militants then "committed a massacre" against civilians as they sought to enter SDF-controlled territory, Khalil said.

Khalil told The Associated Press the attack came a few hours after IS suicide bombers dressed in civilian clothes sneaked into the town of Shaddadeh and attacked SDF forces, triggering clashes that were ongoing.

Issam Amin, a media activist in Hassakeh, said the victims arriving at the city's hospitals had stabbing and knife wounds.

This undated image posted online Monday, May. 1, 2017, by supporters of the Islamic State militant group on an anonymous photo sharing website, purports to show an Islamic State fighter firing his weapon during clashes with U.S.-backed Kurdish-led Syrian Democratic Forces, in the northern Syrian province of Raqqa.

Photo Credit: Militant Photo via AP

The Britain-based Syrian Observatory for Human Rights, which tracks the Syrian conflict through activists on the ground, said Tuesday's attack included suicide bombers and heavy clashes with the SDF. The Observatory put the death toll at 38, including 23 civilians, many of them Iraqi.

The Islamic State group is under attack by an array of forces in Syria and Iraq. In Syria, the SDF is now fighting to recapture the town of Tabqa from ISIS.

The town is an important stronghold for the militants, located about 40 kilometers (25 miles) southeast of their de facto capital, the city of Raqqa. The SDF pushed the extremists to northern neighborhoods of Tabqa, close to one of Syria's largest dams, and Kurdish officials say the battle will be over soon.

In Iraq, the extremist group is fighting for survival against Iraqi forces and their allies in the last neighborhoods it still holds in the western part of Mosul, Iraq's second largest city.

The group claimed responsibility for Tuesday's attacks through its media arm, Aamaq, saying its fighters attacked four Kurdish positions in the southern countryside of Hassakeh province.

Rajm Sleibi lies about 30 kilometers (18 miles) south of the town of al-Hol, which houses a large refugee camp for civilians displaced from Syria and Iraq.  A Kurdish activist said it is the entry point to Hassakeh for Syrians civilians fleeing the eastern cities of Deir el-Zour and Raqqa, and those fleeing from Mosul and elsewhere in Iraq. The civilians initially spend about two weeks in Rajm Sleibi while they get security clearance from Kurdish authorities, and from there are taken then to al-Hol camp.

The activist spoke on condition of anonymity, fearing for his safety.

The camp is within the zone of influence of the SDF but not immediately protected by the forces.

Hawar, a news agency for the semi-autonomous Kurdish areas in Syria, put the death toll at 37.

Tuesday's fighting comes a day before the Syrian government and the opposition were scheduled to resume cease-fire talks in the Kazakh capital, Astana.

Russian President Vladimir Putin said Tuesday that talks to resolve the Syrian crisis cannot be successful without the participation of the U.S. He said Russia is and will remain in contact with its "American partners" and he hopes they will "reach an understanding about joint steps."

The Russian leader is scheduled to have a telephone conversation later Tuesday with U.S. President Donald Trump.

Putin also said Russia expects that steps will be taken to strengthen the cease-fire during the talks in Astana.

Associated Press writers Philip Issa and Bassem Mroue in Beirut, and Albert Aji in Damascus, Syria, contributed to this report.