The Taliban killed one of their former leaders who was known as the first commander of the group hailing from the minority Shi'ite Hazara community, officials confirmed on Wednesday, adding that he had rebelled against the de facto government.

Mawlawi Mahdi was shot dead by Taliban forces near the border with Iran as he attempted to flee the country, the defence ministry said in a statement.

Mahdi's appointment as a commander some years ago was touted as an example of the Taliban's changed on stance on minorities. He was in the spotlight after the Taliban took control of Afghanistan in the wake of the pullout of western forces last year.

The Taliban are hardline followers of the Sunni branch of Islam, and were previously almost exclusively associated with the Pashtun ethnicity. More recently, the group had sought to include members of other ethnicities and some Shi'ites.

The Hazara, native to Afghanistan's central mountains, are the country's largest mainly Shi'ite ethnic group. After the Taliban formed a government last year, Mahdi was given the post of intelligence chief in a central province.

The origins of the breach between Mahdi and the Taliban have not been made public, but as far back as June, the defence ministry had spoken of a clearance operation against rebels in northern Afghanistan.

The defence ministry on Wednesday described Mahdi as a the "leader of the rebels" in a district in the northern province of Sar-e-Pol.

A Taliban source told Reuters that Mahdi had fallen out with the Taliban and had revolted against the group's leadership.

The statement said he was killed in Herat close to the border with Shi'ite majority Iran, where he was trying to flee.

Reuters was not able to contact representatives of Mahdi for comment.

A Taliban fighter on duty in Kabul at the weekend