Afghan President Ashraf Ghani says the Islamic State group has been defeated in eastern Afghanistan, where it had taken over some remote districts.

Speaking at the opening of parliament Sunday, Ghani said Afghan forces had dislodged Islamic State loyalists from regions of Nangarhar province bordering Pakistan.

He says Afghanistan will be a "graveyard" for IS.

IS has had a presence in Afghanistan for more than a year. Officials have said most militants calling themselves IS are disaffected Taliban fighters.

Afghan forces have claimed victory following a 21-day operation in the Achin and Shinwar districts of Nangarhar, claiming at least 200 militants killed.