KABUL (Reuters) - A former warlord accused of historic war crimes entered Afghanistan’s presidential race on Saturday in a new challenge to President Ashraf Ghani who allowed him to return from exile two decades he was forced out by the Taliban.

Slideshow ( 12 images )

Gulbuddin Hekmatyar, whose fighters killed thousands in Kabul during the bloody civil war of the 1990s, has remained a divisive figure since his return from exile in 2016.

His decision to contest the presidential polls in July is seen by analysts as the ex-warlord’s attempt legitimize his Hizb-i-Islami party. The faction has been blamed for atrocities committed during Afghanistan’s brutal civil war, which led many Afghans to welcome the emergence of the Taliban in 1996 in the hope the hardline Islamist group would restore law and order.

In 2003, the U.S. State Department listed him as a terrorist, accusing him of taking part in and supporting attacks by al Qaeda and the Taliban. But Washington later welcomed Ghani’s decision to sign a peace deal with Hekmatyar.

In 2016, President Ghani’s government granted immunity to Hekmatyar but the former warlord has been critical of his administration and the parliamentary election process in 2018.

Announcing his candidacy, Hekmatyar pledged to restore peace and security and said the current government had failed to end the war with the Taliban.

“Our country’s situation requires a powerful central government lead by an elected president supported by the majority of people,” he told a news conference in Kabul.

The July election faces serious security challenges with the Taliban threatening large parts of the country. The polls will be a crucial test for election officials who were criticized for failing to conduct free and fair parliamentary elections last October. The 2014 presidential election won by Ghani was also tainted by accusations of widespread cheating.

Afghanistan’s presidential race is now in full swing, with several former officials, politicians lining up to challenge Ghani who is expected to register his candidacy for a second term on Sunday.

On Saturday Interior Minister Amrullah Saleh resigned to run for the vice-presidency as part of Ghani’s team, according to two political sources.

In December, Ghani appointed Saleh, a former security official and an uncompromising opponent of the Taliban, to his government in a bid to secure the support of former opponents for a second term.