BEIRUT — Turkish troops and allied Syrian rebels expelled the Islamic State from the last strip of territory it controlled along the Syrian-Turkish border on Sunday, effectively sealing the extremists' self-styled caliphate from the outside world, Turkey's prime minister and a Syrian opposition group reported.

Also on Sunday, Syrian pro-government forces backed by airstrikes launched a wide offensive in the northern city of Aleppo, capturing areas they lost last month and besieging rebel-held neighborhoods, state media and opposition activists said.

Turkey-backed Free Syrian Army rebels have cleared the area between the northern Syrian border towns of Azaz and Jarablus, said Turkish Prime Minister Binali Yildirim.

“From Azaz to Jarablus, 91 kilometers (57 miles) of our border has been completely secured. All the terrorist organizations are pushed back. They are gone,” Yildirim said, speaking at a dinner with nongovernment organizations in the southeastern city of Diyarbakir.

The Free Syrian Army's advance shut down key supply lines that the Islamic State used to bring in foreign fighters, weapons and ammunition. The Britain-based Syrian Observatory for Human Rights said the Islamic State “has lost its link with the outside world after losing all border areas” with Turkey.

The Islamic State had occupied the border area even before it declared its self-styled caliphate in June 2014, and it used the Turkish border to bring in fighters from around the world. The group, which controls parts of Syria and Iraq, is now surrounded on all sides by hostile forces.

The loss of its territory along the Turkish border follows a series of recent defeats for the Islamic State, including its expulsion from the central Iraqi city of Fallujah and its defeat in the former stronghold of Manbij in northern Syria. Airstrikes by the U.S.-led coalition have killed a number of the group's most prominent founding members and leaders.

In a statement, Turkey's armed forces said that “the Jarablus-Azaz line has been connected.”

Turkey has long pushed for a safe zone in Syria between these two towns, with a plan to house Syrian refugees there. Turkey hosts an estimated 3 million Syrian refugees.

Meanwhile, the recapture and return to siege of rebel-held parts of Aleppo dealt a major blow to insurgent groups.

Sunday's push came a month after insurgents captured several military academies south of Aleppo and opened a corridor into opposition-held parts of Syria's largest city and onetime commercial center. Since then, government forces and their allies have been trying to recapture their losses.

State TV quoted an unnamed military official as saying that troops are now in full control of the military academies south of Aleppo and are “chasing the remnant of terrorists.” It added that all roads linking rebel-held eastern Aleppo with opposition areas outside the city “have been cut.”

The Observatory confirmed these gains.