SRINAGAR, India (Reuters) - Thousands of people from the northern Indian state of Jammu and Kashmir headed back to their homes near the de facto border with rival Pakistan on Wednesday, after their armies agreed to stop exchanging artillery fire following repeated recent clashes.

FILE PHOTO: A man looks at the wall of his house that the local residents say was damaged by firing from the Pakistan side of the border at Kanachak in Akhnoor Sector on the outskirts of Jammu January 22, 2018. REUTERS/Mukesh Gupta/File Photo

More than 50,000 people had taken shelter in schools and colleges in the Indian-ruled part of disputed Kashmir, away from the shelling that officials say killed 12 people and wounded many more on both sides over the past few weeks.

Mountainous Kashmir is divided between the nuclear-armed neighbors, who both claim it in full and have fought two of their three wars over the region since their separation in 1947. On Tuesday, their armies agreed to “fully implement” a 2003 ceasefire agreement.

“In case of any issue, restraint will be exercised and the matter will be resolved through utilization of existing mechanisms of hotline contacts and border flag meetings at local commander’s level,” Pakistan’s military said in a statement.

Bacchan Lal, the headman of Abdullian village in Jammu and Kashmir, who has been living in a college with 350 other people over the past two weeks, said such agreements rarely last long.

“They agree to respect the ceasefire several times every year but then they violate it again. Every time people are killed, cattle perish and we end up in such camps,” he said. “We are in camps for the second time this year. We don’t want this uncertainty. We want permanent peace as we had 30 years ago”.

Farmer Chuni Lal, 45, said he was worried about a delay in sowing premium Basmati rice this year because of the hostility. He said tillers like him could not afford to miss the key planting season, urging the countries to find a lasting solution to the regular outbreaks of firing.

Jammu and Kashmir Chief Minister Mehbooba Mufti, who runs the state with the support of Prime Minister Narendra Modi’s Hindu nationalist party, welcomed the ceasefire agreement.

“This brings great relief to the people residing in the vicinity,” she said on Twitter on Wednesday. “Peace on our borders is the first essential step to a larger understanding and I truly hope it sustains.”

Tensions between the two sides had escalated since an attack on an Indian army camp in February that India blamed on Pakistan. Islamabad regularly denies Indian allegations that it trains and arms militants and helps them infiltrate across the so-called Line of Control that divides Kashmir.