BEIRUT, Lebanon (CNN) -- At least three British lawmakers have been holding unofficial meetings with militant groups in the Middle East for the past two years, one of the legislators told CNN Thursday.
Michael Ancram in 2005 when he was the UK's shadow Secretary for Defense.
The lawmakers met high-ranking officials from Hezbollah and Hamas, said Michael Ancram, one of the legislators involved.
The British government officially considers both Hezbollah and Hamas to be terrorist organizations, as does the United States. Hamas is also on the European Union's terror list.
Former UK Prime Minister Tony Blair refused to meet with Hamas officials when he was in Gaza on Sunday.
But Blair was aware that the meetings were taking place when he was prime minister, a source familiar with the discussions said.
"The previous prime minister of Great Britain was informed and briefed on these meetings. While without explicitly approving the meetings, he did not direct that they not take place," said the source, whose role in the process must remain secret for diplomatic reasons.
Blair's office did not immediately respond to a CNN request for comment.
The most recent meetings took place in Beirut, Lebanon, at the end of January, when Ancram and another member of parliament sat down with Nawaf Al-Moussawi, Hezbollah's head of international relations.
Hezbollah is a Shiite group which wields significant power in Lebanon and has skirmished with Israel for years.
Ancram said they met separately with Usama Hamdan, the Beirut spokesman for Hamas.
Ancram, a lawmaker for the UK's opposition Conservative party, also quietly traveled to Damascus, Syria, in June 2008 as part of a delegation that met with Khaled Meshaal, a top leader of Hamas, the Palestinian movement which controls Gaza.
Ancram described his meetings with Hamas and Hezbollah as "constructive and informative," and said he feels the talks "indicated... that there was the basis for further dialogue."
The lawmaker said he was not representing anyone in his meetings. "I've been acting on no one's behalf but my own," he said.
Ancram is a former chairman of the Conservative party and has been the party's top spokesman on both foreign policy and defense while the Conservatives have been in opposition.
He was also the minister for Northern Ireland in the mid-1990s when the Conservatives were in power and was the first minister to meet with the Irish Republican party Sinn Fein.
The meetings were facilitated by a non-governmental think tank, which also had representatives at the discussions.
When asked how the meetings came about, Ancram said, "I hoped by opening the process of dialogue informally and on an exploratory basis, might in due course persuade others -- particularly in government -- to do the same.
"I believe however that dialogue with Hezbollah and Hamas will inevitably become necessary at an official level if a Middle East settlement is to be reached."
UK Foreign Office minister Bill Rammell said Wednesday that Britain was prepared to engage with Hezbollah's political wing, which is technically distinct from its military one.
The British government cut off contact with Hezbollah in 2005, but relaxed its stance slightly after the group joined a Lebanese unity government.
"We have reconsidered our position on no contact with Hezbollah, in place since 2005. This is in light of more positive recent political developments in Lebanon, including the formation of the national unity government in which Hezbollah are participating. We are exploring certain contacts at an official level with Hezbollah's political wing, including MPs," the Foreign Office said in a statement. "We have no contacts with Hezbollah's military wing."
Ancram said: "I am pleased that contacts with Hezbollah have begun."
CNN's Metsa Rahimi contributed to this report