Yemeni troops began to deploy in the northern province of Saada on Saturday to monitor a ceasefire between Shiite rebels and hardline Sunni Salafists, a security official said.
The deal brokered late Friday by a presidential commission ends fighting that erupted in late October centred on a Salafist mosque and Koranic school in the town of Dammaj.
But the deadly conflict had spread in the northern provinces, embroiling Sunni tribes wary of the Shiite rebels, known as Huthis, who have been accused of receiving support from Iran.
"Forces have begun deploying in the areas surrounding Dammaj," the Saada-based security official told AFP, adding some gunmen had not yet vacated their posts.
The deal stipulated the two sides would withdraw from the areas around Dammaj to be replaced by army troops who would monitor the ceasefire, said Yahya Abu Isba, head of the presidential mediation commission.
"This agreement ends the military conflict between the Huthis and the Salafists in Dammaj... and prevents a sectarian war that was looming over Yemen," he told state television.
The Huthis, named after their late leader Abdel Malek al-Huthi, are part of the Zaidi Shiite community.
They rose up in 2004 in their stronghold of Saada against former president Ali Abdullah Saleh's government, complaining of marginalisation.
They accuse radical Sunnis in Dammaj of turning the town centre into "a real barracks for thousands of armed foreigners", a reference to the Dar al-Hadith Koranic school, where foreigners study.
Signup to our newsletter and follow us on Facebook and Twitter!
The security official said a plane was expected to evacuate "foreign students" and the leader of the Salafists in Dammaj, Yahya al-Hujuri, on Saturday.
Sources in the mediation commission told AFP that Hujuri had requested President Abdrabuh Mansur Hadi decide on a solution for the Koranic school and its foreign students, while providing protection for the town.
Dammaj has a population of about 15,000 people.
The Red Cross said it evacuated 25 casualties from Dammaj on Saturday after the ceasefire.
The wounded, some of whom are in a critical condition, have been airlifted from Saada airport to Sanaa, the spokeswoman for the International Committee of the Red Cross in Yemen, Marie Claire Feghali told AFP.
The ICRC said on Monday it evacuated 34 critically wounded casualties from Dammaj, taking advantage of an earlier truce, as it has done five times since fighting resumed in the area on October 24.
On Wednesday, a presidential commission also brokered a ceasefire between the Huthis and gunmen from the powerful Hashid tribes, ending two days of clashes in the northern province of Amran.
Fighting had erupted on Monday when Huthi rebels tried to seize the towns of Wadi Khaywan and Usaimat, strongholds of the Hashid tribe in Amran.
The two sides also agreed to the deployment of monitors.
Clashes have also spread to the provinces of Jawf, which borders Saudi Arabia.
President Hadi has sent mediators to areas of conflict in the country as national talks aimed at drafting a new constitution appear close to conclusion.