Gulbuddin Hekmatyar signed the agreement via a video link into Kabul's presidential palace. The ceremony was broadcast live on television.
It is the first peace treaty the Afghan government has completed since the war with the Taliban began in 2001.
It has been welcomed by the international community as a possible template for any future peace deal with the Taliban, who have been fighting to overthrow the Kabul government for 15 years.
The head of his delegation in Kabul, Amin Karim, told The Associated Press yesterday that he believes the sanctions could be lifted within weeks.
More From This Section
Hekmatyar's party, Hezb-i-Islami Gulbuddin, is listed by the United Nations as a foreign terrorist organization.
Hekmatyar himself was designated by the U.S. As a "global terrorist" in 2003.
He is widely disliked and distrusted by ordinary Afghans for his past extremism, including his support for al-Qaida, and for carrying out sustained rocket attacks on Kabul during the 1990s civil war that are believed to have killed thousands of people.
The 25-point peace agreement gives Hekmatyar and his followers immunity for past actions, and grants them full political rights.
In a speech greeted with chants of "Long Live Hekmatyar" from his supporters, who had gathered in the presidential palace, he called on the Afghan government to start peace talks with the Taliban.
Ghani, who has said the deal with Hezb-i-Islami should be an example to the Taliban, said that "now is the time for the Taliban to decide whether they want to continue the war, or participate in peace talks."