Al-Qaeda fighters agreed on Tuesday to withdraw from the central Yemeni city of Rada, which they seized a week ago, a military source said.
"Tribal mediation carried out by Sheikh Hashed Fadhl al-Qawsi succeeded, after three days of talks, to convince the armed Al-Qaeda men to leave Rada," a senior official told AFP.
"Members of Al-Qaeda began evacuating public buildings that they had occupied" after taking the town on January 16, the source said.
"They are leaving the location without resistance," he added.
A local dignitary, Ahmed Kalaz, confirmed the exit of Islamist fighters he described as close to Tarek al-Dahab, the brother-in-law of the Yemeni-American militant, Anwar al-Awlaqi, killed by a US strike last September.
"They've retreated to al-Mazah," Dahab's native village located 30 km (19 miles) southeast of Rada, Kalaz said.
Signup to our newsletter and follow us on Facebook and Twitter!
Kalaz said tribal mediators succeeded in convincing the militants to accept the release of 15 of their members held by Yemen authorities without trial in return for evacuating Rada.
Among the prisoners to be set free was Nabeel al-Dahab, a brother of the Qaeda group's leader, Kalaz said.
Al-Qaeda militants swept into Rada last week and overran it within hours, marking a significant advance by the extremists towards the capital.
The takeover of Rada, 130 kilometres (85 miles) southeast of Sanaa, was the latest in a series of towns and cities -- until now deeper in the south and east -- to fall as Al-Qaeda takes advantage of a central government weakened by months of protests.
Sources in the town had said more than 1,000 Al-Qaeda gunmen invaded Rada, which is within striking distance of a strategic highway connecting Sanaa with the south and southwest.
Al-Qaeda-linked militants already control a string of towns in Abyan, Shabwa and Marib provinces, but Rada is the closest they have come to the capital.
The strong jihadist presence in Yemen made President Ali Abdullah Saleh a key ally in Washington's "war on terror" before the Arab spring uprisings sparked a wave of protests against his regime that he countered with deadly violence.