The ceasefire in Syria is "largely" holding despite intense fighting in the Wadi Barada valley, the United Nations (UN) has said.

Syrian forces have been engaged in a campaign to retake the area, 18km (11mi) outside of Damascus, after Al Qaeda-linked militants rejected a deal to leave, when the ceasefire was drafted.

Both sides of the conflict seek to control the Wadi Barada valley due to its immense strategic significance. Namely, it controls the capital's water supply.

More than five million people have been without running water since the water supply was contaminated on 27 December 2016.

Forces and media sources loyal to Syrian President Bashar al-Assad say the militants contaminated the water supply with diesel, whereas militants have said the contamination was caused by government air strikes.

Staffan de Mistura, UN special envoy to Syria, said it was imperative a deal between Assad and the militants was reached to prevent further suffering.

"There is [substantial danger] that this may develop into a further military escalation, and the consequence of it, unavoidably, [will be there will be] no water solution for the people in Damascus," he said.

However, de Mistura noted there were some positive signs in that five villages in the Wadi Barada valley had already reached agreements with the Syrian government.

wadi barada
Wadi Barda valley in Syria, 18km outside of Damascus. Getty

There were only two villages – particularly al-Fijah, which controls the majority of water supplies – who have not.

De Mistura added he hoped to see a deal in place before peace talks, brokered by Russia and Turkey, commenced on 23 January in the Kazakhstan capital of Astana.

He said: "Water in Damascus is vital, it affects five million people, and it does have the potential, if it escalates, to impact on the Astana talks and meetings which are based on the concept of a well-established and potentially even better established cessation of hostilities."

"So there is a sense of urgency linked both to water and to Astana and we are definitely in that direction too," de Mistura added.

He said water engineers are standing by to fix the damage caused by fighting between government-backed and opposition forces.

Jan Egeland, the UN's humanitarian adviser for Syria, said he could not determine who was responsible for the contamination at this stage, but warned that sabotaging water supplies was a war crime.