ISTANBUL (Reuters) - A Turkish soldier was killed in a rocket and mortar attack in northwest Syria as Turkish forces were setting up a military post in the largest remaining stronghold of opposition to President Bashar al-Assad, Turkey’s military said on Tuesday.

It was the second attack in a week on Turkish soldiers trying to establish a position near the front line between rebels and pro-Syrian government forces, under a deal with Russia and Iran meant to reduce fighting in the area.

That deal largely collapsed in December when the Syrian army along with Iran-backed militias and heavy Russian air power launched a major offensive to take territory in Idlib province and surrounding areas.

Turkey said five soldiers were also wounded in Monday night’s attack. A civilian member of the Turkish contingent was also wounded, according to the military.

The army began setting up the outpost on Monday southwest of Aleppo city, the deepest position Turkey has established so far inside northwestern Syria under the agreement with Moscow and Tehran aimed at “de-escalating” the violence.

Turkey, which supported rebels trying to overthrow Assad, has worked with Assad’s main international backers Russia and Iran in recent months to try to stem some of the bloodshed in Syria’s nearly seven-year-old civil war.

But all three countries remain deeply involved in the conflict, and stark divisions remain.

Iran urged Turkey on Monday to halt its two-week-old military offensive against the Kurdish YPG militia in northern Syria’s Afrin region, which is adjacent to Idlib.

“Turkey’s actions can bring back insecurity, instability and terrorism to Syria,” Iranian Foreign Ministry spokesman Bahram Qasemi was quoted as saying by state news agency IRNA.

In Idlib, Russia has intensified air raids on rebel-held towns after jihadist fighters shot down a Russian warplane and killed its pilot. Iran-backed Shi’ite militias also helped the Syrian army advance in the region last week.

On Tuesday, the United Nations called for an immediate humanitarian ceasefire of at least one month as heavy air strikes were reported to have killed at least 30 people in rebel-held areas near Damascus and in the northwest.

In an apparent warning to Turkey, a commander in the military alliance backing Assad said the Syrian army had deployed air defenses and anti-aircraft missiles to front lines with rebels in the Aleppo and Idlib areas close to Turkey.

“They cover the air space of the Syrian north,” the commander told Reuters. That would include the Afrin area where Turkish warplanes have been supporting a ground offensive by the Turkish army and Free Syrian Army rebel factions.

Turkish President Tayyip Erdogan said the military operations in Afrin and Idlib would continue, and repeated Turkey’s demand for U.S. forces to pull back from the town of Manbij where they are stationed alongside Kurdish-led forces.

“We will come to Manbij to deliver the land to its true owners,” Erdogan told a session of parliament, referring to Arab occupants of Manbij who say they were driven out of the town by the Kurdish YPG-dominated Syrian Democratic Forces (SDF).

Erdogan said the United States was setting itself up against Turkey, Iran and possibly Russia by arming the SDF in a large part of northern Syria which borders Turkey. Washington says it wants to continue the fight against Islamic State and to create a bulwark against Iranian influence in Syria and Iraq.

Turkey says the YPG fighters Washington is supporting are part of the Kurdish Workers Party (PKK), which has fought an insurgency in southern Turkey for three decades.

“If the United States says they are sending 5,000 trucks and 2,000 cargo planes of weapons for the fight against Daesh (Islamic State), we don’t believe this,” he said. “It means you have calculations against Turkey and Iran, and maybe Russia.”

The Syrian Observatory for Human Rights monitoring group said the observation post being established by Turkey was near the village of al-Eis, which would place it less than five km (three miles) from territory held by Syrian government forces and their allies.

A week ago, a large Turkish military convoy heading for the same area withdrew after it was hit by a car bomb which killed one person.