A senior Taliban leader has been freed by the United Arab Emirates and has returned to Afghanistan to help jump-start President Hamid Karzai’s efforts to reach a negotiated settlement with the militant group, officials said Monday.

Agha Jan Motasim, the Taliban’s former finance minister, was detained by UAE officials about a month ago for unknown reasons. At the time, Motasim was talking to Afghan government officials about how best to reach a peace deal with the Taliban.

Karzai condemned the detention, saying through his spokesman that “secret enemies of peace in Afghanistan” were “sabotaging” the peace process.

Motasim was released over the weekend after Karzai reached out to UAE leaders, officials said. Citing concern for Motasim’s safety, the officials declined to provide further details about his release, except to say that he is now in Kabul.

Karzai says that Motasim, who is Taliban leader Mullah Mohammad Omar’s son-in-law, may be able to work with members of the Afghan High Peace Council to engage in high-level discussions with Taliban figures.

Karzai, who is leaving office this year after two terms as president, says a negotiated settlement is the only way to end years of bloodshed as the U.S.-led coalition in Afghanistan withdraws. Such a deal could help Karzai bolster his legacy, which is clouded by allegations of corruption and erratic behavior.

Still, U.S. officials and many observers are skeptical that any lasting peace deal with the Taliban can be reached.

In recent weeks, U.S. officials have privately questioned Motasim’s standing within the Taliban organization, saying his influence has waned considerably over the years.

Widely regarded as a moderate, Motasim sought refuge in Turkey after he was seriously wounded in a 2010 assassination attempt in Karachi. In Turkey, he began giving news media interviews in which he stressed the need for reconciliation between the Afghan government and Taliban leaders.

Last year, he traveled to the UAE to work with High Peace Council members on preliminary discussions about who best could set up a formal dialogue between Karzai’s government and Taliban commanders.

But that process has been hobbled by numerous setbacks.

In June, planned peace talks in Doha, Qatar, did not occur, because of a dispute about a Taliban banner that referred to the “Islamic Emirate of Afghanistan,” the group’s name when the Taliban ruled the country before the U.S.-backed invasion in 2001.

In February, Abdul Raqeeb, the former minister of Refugees for the Taliban, was assassinated in Quetta, in Pakistan, after he had traveled to the UAE to meet with peace council members. The attack deepened Karzai’s suspicions that Pakistan is trying to undermine his peace effort.

Further complicating the peace process, Afghan Taliban commanders believed to be most active in the group’s day-to-day operations have shown little interest in a negotiated peace agreement.

Still, Karzai remains optimistic and is expected to press Motasim to continue his efforts. The window for such talks, however, may be narrowing. Karzai is expected to leave office this summer after the Afghan presidential election.