A Yemeni official in Aden said the two men, Shahid Butt and Sarmad Ahmad, were freed from prison in southern Yemen.
A British diplomat confirmed their release and said they were due to leave for Britain late on Wednesday.
The two were convicted by a Yemeni court in 1999, along with six other Britons of Pakistani or Arab origin, of forming an armed group to carry out "terrorist" acts in Yemen.
Most received terms of up to seven years, but three were sentenced to time served and returned to Britain that same year.
Another was freed in 2002 at the end of his sentence.
The eight initially made confessions, which they later retracted. They said they came to Yemen to study the Quran.
The eight Britons, along with two men of Algerian descent, were arrested after 16 Western tourists were kidnapped in Yemen in 1998.
Four of the tourists were killed in a botched army rescue attempt.
Yemen wants Britain to hand over Abu Hamza al-Masri, father of the Briton freed in 2002, for trial on alleged involvement in the kidnapping. Masri, an Egyptian-born British citizen heads the London-based Supporters of Sharia (Islamic law) group.
Yemen, the ancestral home of al-Qaida leader Usama bin Ladin, is working closely with the US war on "terror" to shed its image in the West as a haven for Muslim fighters.