Gulbuddin Hekmatyar, a notorious Afghan warlord known as the "Butcher of Kabul," returned to the city he so often attacked with rockets and was welcomed Thursday by President Ashraf Ghani, who thanked him for "heeding the peace call."

Hekmatyar, 69, is among the most prominent surviving figures from the early days of war that began with the Soviet invasion of Afghanistan in 1979 and grinds on to this day.

"Let's end the war, live together as brothers and then ask foreigners to leave our country," Hekmatyar said in his appearance with Ghani at the Presidential Palace.

On the one hand, Hekmatyar's peaceful return to the Afghan capital — made possible by his agreeing to abide by the country's constitution and renounce violence — cautiously raises hopes that Ghani's government can persuade rivals and enemies to stop fighting and bring an end to nearly four decades of conflict.

Yet Hekmatyar is despised by many Afghans. There's also the possibility that he and his followers in the hardline Hezb-i-Islami party will only increase tensions as the government struggles with political, economic and military challenges.

Hekmatyar has been involved in every stage of the Afghan war.

As seven main Afghan factions fought the Soviets in the 1980s, Hekmatyar's group was considered to have the best fighters. The U.S. and its allies funded the rebel effort, with Pakistan serving as the conduit. The Pakistanis were also partial to Hekmatyar and his fighters, and are believed to have given more weapons to Hezb-i-Islami than any other group.

President Reagan and other U.S. officials called the mujahideen rebels "freedom fighters" and there were no worries at the time about the radical Islamist positions that Hezb-i-Islami and others espoused. The larger aim was driving out Soviet forces, and Hekmatyar's group was very effective.

But after the Soviets pulled out in 1989, U.S. interest in Afghanistan declined dramatically, and the Afghan mujahideen factions waged a bitter civil war during much of the 1990s.

Once again, Hekmatyar was a central figure.

His group controlled the hills on the edge of the capital and fired rockets indiscriminately on the city, destroying entire neighborhoods that dated back centuries. An estimated 50,000 were killed and many more injured, almost all civilians, from 1992 to 1996.

This was an extremely nasty period in the war, and Hekmatyar, accused of atrocities and human rights violations, became known as the "Butcher of Kabul" — the most ruthless warlord in a country dominated by warlords.

Afghanistan's President Burhanuddin Rabbaniwas so desperate, he named Hekmatyar the prime minister in 1993 in an attempt to end the fighting. Yet Hekmatyar remained at his base just to the southeast of the city, and his forces pressed ahead with their rocket barrage on most days.

When a cabinet meeting was planned, the rockets would cease and Hekmatyar's heavily armed convoy would roll into the center of Kabul so he could preside over the talks.

There was no need to parse wishy-washy statements afterward. If the meeting went poorly, Hekmatyar and his convoy simply drove out of the city and resumed bombardment.

His government did not last long.

I met with Hekmatyar under tense circumstances in 1993. His forces seized an Associated Press reporter,John Jennings, who was covering a skirmish outside Kabul. I was an AP correspondent at the time, and traveled from Pakistan to Afghanistan to seek Jennings' release.

It was possible to drive across the front line when the shooting died down during the Muslim prayer times.

I drove to Hekmatyar's base, where he said he was unaware that his faction was holding Jennings — though he was being detained a short distance away. After several long days of waiting in Kabul, I was summoned by Hekmatyar's men and returned to the base, where Jennings and another journalist were released unharmed.

Hekmatyar was forced away from the capital in 1995 by the advancing Taliban, who captured Kabul the following year. He disappeared from public view after that, taking refuge first in Iran. Later, he was believed to be in the Afghanistan-Pakistan border region.

His forces remained active in the Afghan fighting, battling the Taliban until the group was ousted in 2001 by the U.S.-led coalition.

Then Hekmatyar fought against the U.S.-backed government in Kabul, and called for the Americans — his supporters in the 1980s — to leave Afghanistan.

The U.S. formally declared Hekmatyar a "global terrorist" in 2003. The U.N. also designated him as a terrorist. His group steadily declined in power over the years, and last September, the white-bearded Hekmatyar agreed to renounce violence and make peace with the Afghan government. The U.N.took him off its terrorist list in February.

But he did not return to Kabul until Thursday.

For Ghani's government, this is a rare positive note — assuming Hekmatyar and his supporters abide by the deal and don't create new political problems.

In remarks last week, Hekmatyar called on the Taliban to "join the peace caravan and stop this pointless holy war."

His return suggests how the Afghan war could end someday: not on the battlefield, but in agreements with groups — like the Taliban — that have committed terrible violence.

Still, his presence in the capital will be a bitter pill to swallow for Kabul residents who remember the pain he inflicted in the 1990s. There's been no indication that he will have a role in the government.

U.S. forces in Afghanistan still number more than 8,000 and the U.S. commander, Lt. Gen. John Nicholson, is seeking more for a war that he says is a "stalemate." But the U.S. role now is limited, consisting mostly of air strikes and training the Afghan military, and few analyst see the prospect of a decisive military victory.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.