"We understand he was held by a tribal group," the U.K. Foreign Office said, adding "there was no operation to free him."
His release was facilitated by the Yemeni government, which engaged with tribal intermediaries.
Harvey was abducted on February 12 while returning home from work at an educational institute in Sanaa. Initially, there were concerns that he had been abducted by members of al-Qaida in the Arabian Peninsula.
The newly freed teacher is currently at the British embassy in Sanaa.
The British government has a travel advisory in place for Yemen, warning its nationals that "There is a very high threat of kidnap from armed tribes, criminals and terrorists."