Syrian government forces opened a corridor on Thursday for people who want to leave insurgent territory in northwest Syria, where an army offensive has gained ground.

Tens of thousands of people have fled toward the Turkish border in recent days as air and ground attacks battered parts of Idlib and Hama in the northwest, the last big rebel stronghold.

After the collapse of a brief ceasefire this month, Syrian army troops, backed by Russia, have now marched into a town in Idlib province in rebel hands since 2014.

The United Nations says hundreds of people have been killed since the offensive began in late April. More than 500,000 people have been uprooted since, it says. Most escaped deeper into the rebel bastion and toward the border, while about 30,000 have fled into government territory.

"The Syrian Arab Republic announces the opening of a humanitarian corridor in the [town] of Soran," state news agency SANA said, citing a foreign ministry source.

The corridor would allow people to leave the southern part of Idlib and the north of Hama. Those who come out will receive food, shelter and healthcare, it said.

It's impossible today for people to head toward the Syrian regime's areas. These people have escaped the regime. - Naji Mustafa, rebel group spokesperson

The head of the state's reconciliation committee, Ali Haidar, said getting civilians out would help troops take "military and security measures" in the region. He repeated the Damascus government's vow to "liberate every inch of Syria."

Naji Mustafa, spokesperson for the National Liberation Front rebel coalition, dismissed the opening of the latest corridor as an attempt to hit morale.

"It's impossible today for people to head toward the Syrian regime's areas. These people have escaped the regime," he said.

UN estimates put the population of northwest Syria at nearly three million people. Many poured into the region after fleeing fighting in other parts of Syria that President Bashar al-Assad recovered with Russia and Iran's help.

Syria-Turkey tensions rising

Moscow and Damascus say they are responding to militant attacks by the former Nusra Front, a jihadist alliance now known as Hayat Tahrir al-Sham. It is the dominant force in Idlib, where Turkey-backed factions also have a presence.

Under its deals with Russia and Iran, Turkey has forces stationed at a dozen military posts in Idlib. The latest army advances in the northwest have put Turkish troops in the firing line and threaten Ankara's hopes of preventing a new wave of refugees on its border.

This photo shows a Civil Defense worker searching for victims from under the rubble of a destroyed building that was hit by airstrikes in the northern town of Maaret al-Numan, in Idlib province on Thursday. (Syrian Civil Defense White Helmets via AP)

Government warplanes carried out an airstrike close to a Turkish military post in northwestern Syria, raising tensions between the two neighbours.

There was no immediate word of any casualties.

Turkey's state-run news agency said a Turkish observation post, north of Khan Sheikhoun, came under "harassing fire" by Syrian government jets.

The Britain-based Syrian Observatory for Human Rights said Syrian warplanes struck an area nearly 300 metres from the Turkish military post.

The incident comes days after airstrikes targeted a Turkish army convoy heading toward another Turkish observation post, killing three civilians and wounding 12 others.