At least 20 people were killed and dozens more injured after a car bomb rocked the Syrian town of Huraytan, five kilometers north of Aleppo, on Thursday. (YouTube/Huraytan City)

Islamic State militants swept into villages in northwestern Syria as part of a surprise offensive against rival insurgents on Friday, activists said. The militants threatened the country’s largest city, Aleppo, and dealt a blow to more moderate rebels under fire from Russian warplanes.

The Islamic State advance comes as Russia has backed a Syrian government offensive against rebel fighters elsewhere in the north and west in recent days. Russia says its military intervention in Syria is aimed at defeating the Islamic State. But most of Russia’s airstrikes have targeted Western-backed rebels instead of Islamic State infrastructure, U.S. officials say.

The Islamic State extremists, who have captured wide swathes of territory in Syria and Iraq, seized at least five villages and a rebel-held infantry school in Aleppo province on Friday, according to Syrian activists and an online statement issued by the group. The gains were the most significant for the Islamic State in Syria in months, according to the Britain-based Syrian Observatory for Human Rights, a monitoring group.

The infantry school is about 10 miles northeast of Aleppo and just a mile from a government-run industrial zone in the suburbs. Despite the Islamic State’s push toward regime-controlled areas, however, the jihadists were not struck by Russian warplanes, activists said.

Map: What a year of Islamic State terror looks like

In a statement issued on Friday, Russia’s defense ministry claimed to have killed 100 insurgents, including two Islamic State field commanders, in a strike on an ammunitions depot near the city of Aleppo. It was unclear whether the air raid was related to the jihadists’ advance on the city, which has been ravaged by fierce battles between government troops and rebels in the four-year war.

Aleppo province is the area where the United States has planned to increase its own airstrikes against the Islamic State, hoping to push the militants back to the east. As part of an agreement with the Turkish government, U.S. aircraft, and that of other coalition partners in the future, have been allowed to fly out of Turkey’s Incirlik airfield, close to the region. But the proximity of Russian aircraft and debilitation of the rebels have now brought those plans into question.

Also in Aleppo, Islamic State militants killed an Iranian brigadier general and adviser to the Syrian government, Hossein Hamedani, Iran’s official news agency said Friday. Russia and Iran are both staunch allies of Syrian President Bashar al-Assad, and Iran has long stationed military advisers in the country.

“Brig. Gen. Hamedani was martyred by Daesh terrorists during an advisory mission in the suburb of Aleppo” on Thursday afternoon, said a statement from Iran’s elite Revolutionary Guard Corps that was read on Iran’s IRNA news agency. “Daesh” is the Arabic acronym for the Islamic State.

But the progress made by Islamic State fighters comes at the expense of rebel groups opposed to Assad and the jihadists. Those groups, which the United States has viewed as the most palpable allies in Syria’s messy civil war, are now confronting both the Islamic State and Russian firepower.

In Hama and Idlib provinces, Russian air raids have targeted rebels aligned with the more secular Free Syrian Army and other non-Islamic State groups this week. The rebels have managed to slow a government advance on opposition strongholds there, destroying the regime’s armored vehicles with antitank missiles, local residents said. On Friday, Defense Secretary Ashton B. Carter confirmed that the United States had indications that four Russian cruise missiles fired from the Caspian Sea landed in Iran instead of Syria this week.

But anti-government activists are worried the rebels will eventually capitulate to Russia’s military might. Russia’s defense ministry said Friday it had flown nearly 70 sorties in five of Syria’s 14 provinces overnight.

“They are fighting on [Assad’s] behalf,” Idlib-based Syrian activist Raed Fares said of the Russians in an interview this week. “And to preserve their own ally” in Syria, he said.

Karen DeYoung in Washington contributed to this report.

Read more:

Russia’s move into Syria upends U.S. plans

This is Russia’s air power in Syria

Russia declares partial victory in bombing campaign in Syria

Washington and Moscow begin talks about Syria conflict