Gulbuddin Hekmatyar, a controversial Afghan militia leader who has spent the past two decades as a fugitive abroad, returned Thursday to the city he once attacked mercilessly and made an impassioned appeal for peace and unity in his war-torn homeland.

 The extraordinary scene was unimaginable even a year ago, when Hekmatyar was a wanted terrorist under U.N. sanctions, leading armed fighters against NATO and Afghan forces in a part-time alliance with the Taliban, and hundreds of his followers were in prison.

“I have come to cooperate with the government to help end the war and restore peace,” Hekmatyar, 69, told about 2,000 people at a ceremony in the presidential palace. He urged the militants to join the peace process to “end all reasons for the presence of foreign troops” in Afghanistan.

President Ashraf Ghani embraced Hekmatyar and declared that his return, under a peace agreement they signed in September, shows that “an end to hostility and strife can be achieved.”

 Once a ruthlessly effective anti-Soviet militia leader in the 1980s, Hekmatyar was bankrolled by the CIA but later turned against the West. He has denounced U.S. military intervention in Afghanistan for years, and he reiterated that stand in his speech Thursday, while vowing to reject violence.   

Hekmatyar, who served two brief stints as prime minister, became embroiled in the civil war of the early 1990s. As he and other warlords fought for control of Kabul, his rockets badly damaged several districts and killed thousands of people, earning him the nickname the “Butcher of Kabul.” 

When the Taliban took power in 1996, he fled to Iran; after the Taliban was driven out in 2001, he took up arms against the government of President Hamid Karzai while reportedly hiding in Pakistan. He also called for jihad against the United States, and in 2003 he was designated a “global terrorist” by the U.S. government after declaring support for al-Qaeda. His forces were reportedly behind two attacks on helicopters carrying foreign troops in Afghanistan.

Last fall, with Taliban insurgents gaining momentum, Ghani proposed a deal with Hekmatyar, encouraged by the United States, which took months of negotiations. The president offered him full amnesty for wartime abuses and asked the United Nations to lift its ban if Hekmatyar would return to civilian life and help persuade the Taliban to end its nearly 16-year guerrilla war.

On Thursday, the deal came to fruition when Hekmatyar roared into Kabul in a caravan of fast-moving trucks and SUVs full of armed men. Several hours later, he appeared at Ghani’s side in the palace, where his speech was repeatedly interrupted by shouts of “God is great!”  

Yet despite the celebratory glow, there was concern that his return could become a new source of tension in Afghan politics. Many of his former foes, now in positions of power, are said to fear that his Hezb-i-Islami party, which split into factions in his absence, could coalesce around him and make a bid for power. 

As for the Taliban, which has been both ally and rival to the party in the past, its current leaders have portrayed Hekmatyar as a criminal and a traitor to Islam. Some analysts said they view him as potentially competing for support among fellow ethnic Pashtuns.

Taliban fighters also appear to show little interest in negotiations after making a series of territorial gains and staging numerous deadly attacks, including infiltrating an army base last month and killing at least 140 Afghan military personnel.

Critics have complained that Ghani’s peace deal gives too many concessions to Hekmatyar, including the right to bring armed guards with him and the release of hundreds of prisoners from his once-banned party. Disputes over the prisoner release delayed his return for weeks.

On Monday, the first release of 68 men was abruptly canceled after Hekmatyar’s aides were told that 13 names had been crossed off the list. By Tuesday, the dispute had been smoothed over, and 55 men walked out of Kabul’s Pul-i-Charki prison, where they were given flowers, new clothes and turbans at a private welcome ceremony.

There has also been opposition from human rights activists and Kabul residents who recall Hekmatyar’s ferocious rocketing of the capital. On Thursday, a group of elders waiting for his caravan said they admired him as a “hero of jihad” against the Soviets, but others said his wartime cruelty should not be forgiven.

“I know people have high hopes today, but we have to remember all the innocent people he killed, the children left orphans,” said Faisal Khan, 24, a business student. Around him, men and boys cheered as the convoy of trucks, some mounted with machine guns, sped past. Hekmatyar, white-bearded and wearing spectacles, waved from inside a white SUV.

 In his palace speech, Hekmatyar took pains to portray himself as sincerely committed to the cause of peace. He spoke forcefully and emotionally, chiding officials and politicians for their quarrels and begging them to unite for the sake of peace and stability. 

“I am bringing my family to Kabul to send a clear message to all Afghans. From now on, this will be our home as well as our grave, and we will not abandon it for anyone,” he said, challenging other Afghan officials to do the same. Many have moved their families abroad because of insecurity. 

Hekmatyar insisted that he had no thirst for power and that he wants to act as a bridge among all groups. Yet he also expressed some less-diplomatic views, denouncing the national news media as inflammatory and saying the Ghani government was divided and dysfunctional. 

In some ways, Hekmatyar is a misfit in a democratizing society, a charismatic but autocratic leader emerging from years of conflict, clandestinity and vertical control over a party based in Pakistani refugee camps, now expected to operate in an open system roiled with internal conflict.

It is not clear what role the aging former warrior, who now styles himself as an Islamist intellectual, will play in his splintered party, which includes cabinet ministers in Kabul, long-haired fighters from forest lairs on the Pakistan border, and professionals who have just returned from exile in Europe.

On Friday, Hekmatyar is expected to give a rabble-rousing speech at the national sports stadium here to thousands of energized supporters, including hundreds of armed followers. But some longtime observers seem convinced he is the man who can get peace talks back on track. 

“He is a man of education and Islam, not a thief or a terrorist,” said Mohammed Aman, 58, a veteran Hezb-i-Islami member in the palace audience. “He was far away for a long time, so many wrong things were said about him. Now he is back, and people will see who he really is. Just wait and see.”