Afghanistan is expected to finalize a peace deal with a notorious militant group in the coming days, in what could be a template for ending the 15-year war with the Taliban, a government official and a representative of the militant group said Saturday.

The deal is partly symbolic as the group in question, Hezb-i-Islami, has been largely inactive for years, but it marks a breakthrough for President Ashraf Ghani, who has made little progress in reviving peace talks with the far more powerful Taliban.

Under the 25-point agreement, a draft of which was seen by The Associated Press, Hezb-i-Islami would end its war against the government, commit to respecting the Afghan constitution and cease all contact with other insurgents. In return its members would receive amnesty and its prisoners would be released.

Ataul Rahman Saleem, deputy head of the High Peace Council — a government body charged with negotiating an end to the war — told the AP that the deal could be completed on Sunday, after two years of negotiations. A senior representative of Hezb-i-Islami, Amin Karim, also said he expected Ghani to approve the final version of the agreement on Sunday.

Hezb-i-Islami is led by warlord Gulbuddin Hekmatyar, whose forces killed thousands of people in Kabul during the 1992-1996 civil war. He is believed to be in Pakistan, though Karim has said he is in an unspecified location in Afghanistan. He could soon return to Kabul to sign a formal peace deal and take up residence.

Hekmatyar, in his late 60s, is designated a "global terrorist" by the United States and blacklisted by the United Nations. The agreement obliges the Afghan government to work toward lifting those restrictions.

The group has had only a minor role in the conflict in recent years. Its last major attack killed 15 people, including six American soldiers, in Kabul in 2013.

The Obama administration has welcomed the progress toward a peace agreement and said it supports an Afghan-led resolution to the conflict. Hezb-i-Islami should be part of the negotiations along with all other insurgent groups, a senior Obama administration official said in a statement. The official wasn't authorized to comment by name and requested anonymity.

U.S. officials declined to say publicly whether the U.S. would consider lifting the terrorist designation subjecting the group to sanctions if the agreement is reached.

Ghani's spokesman, Zafar Hashemi, would not comment directly on the Hezb-i-Islami deal, telling reporters Saturday that "the doors are open for peace talks" to all groups. He added, however, that "there are developments" and "optimism."

Ghani is due to return to Kabul on Sunday from an official visit to London. Karim said he expected the president to give his final approval to the agreement soon after his return.

Negotiations began in July 2014, Karim said, when Hekmatyar received a letter from Ghani, who was then campaigning to become president. Ghani pointed out that one of Hekmatyar's key conditions for peace — the withdrawal of all foreign troops from Afghanistan — was about to be met.

"That was the beginning," Karim said.

But progress stalled after President Barack Obama decided against a complete withdrawal and instead to leave a 10,000-strong, largely noncombat force in the country through the end of 2016.

Earlier this year, Hekmatyar began referring to his demand for the withdrawal of all foreign troops as a "goal" rather than a condition, clearing the way for talks to continue.

The political wing of Hezb-i-Islami, which has long had a significant presence in Afghanistan's parliament, has no relationship with Hekmatyar, and its members endeavor to address grassroots concerns rather than engage in high-level politics.

A Taliban spokesman, Zabihullah Mujahid, said the deal with Hezb-i-Islami would have "no impact" on the overall peace process because "a majority of Hezb-i-Islami members are already part of the government."

The agreement includes a guarantee of equality between men and women and respect for the Afghanconstitution, both points of contention with the Taliban.

It gives legal immunity for "all past political and military proceedings" by Hezb-i-Islami members and mandates the release of all prisoners within three months. Karim said there are about 2,000 Hezb-i-Islami prisoners in Afghan jails.

Under the agreement, Hekmatyar would have a "consultant" role on "important political and national decisions." The Afghan government would provide housing and security for Hekmatyar at two or three residences in places of his choosing.

The two sides also commit to bringing millions of refugees home from neighboring Iran and Pakistan. The first stage would be to repatriate 20,000 from Pakistan "with the help of the international community."