"The United Nations is following developments closely and shares the concerns of people living in the region for peace," a statement issued by Ban's spokesperson here said.
Ban expressed hope that the perpetrators of the attack will be brought to justice and all stakeholders will meet their responsibilities to maintain peace and stability.
He "hopes that all involved will prioritise the re-establishment of stability and prevent any further loss of life. The Secretary-General encourages all stakeholders to meet their respective responsibilities to maintain peace and stability," the statement said.
Condemning the "militant attack", Ban expressed his "deepest sympathy and condolences" to the families of the soldiers who lost their lives and to the government of India and wished a speedy recovery to those injured in the attack.
Also Read
Meanwhile, Venezuela President Nicolas Maduro, who succeeded Iranian President Hassan Rouhani as the head of the Non-Aligned Movement, also expressed solidarity with the people of India "who have suffered a terrorist attack."
In one of the deadliest attacks on the Army in recent years, 17 soldiers were killed and 19 others injured as heavily armed militants stormed a battalion headquarters of the force in North Kashmir's Uri town early yesterday.
Four militants involved in the terror strike were killed by the Army.
The UN has long maintained an institutional presence in the contested area between India and Pakistan.
According to the Security Council mandate given in resolution 307 of 1971, the UN Military Observer Group in India and Pakistan (UNMOGIP) observes and reports on ceasefire violations along and across the Line of Control and the working boundary between the South Asian neighbours in Jammu and Kashmir, as well as reports developments that could lead to ceasefire violations.
India has however always maintained that UNMOGIP has "outlived its relevance" and has "no role to play whatsoever".
UNMOGIP currently comprises 41 military observers and a number of civilian staff members.