Speaking at the opening of parliament, Ghani said that Afghan military forces have cleared some regions of Daesh terrorists in Nangarhar Province.
"Afghanistan will be their graveyard," the president said in an address broadcast live on national television, Press TV reported.
The remarks come as Afghan forces have claimed victory following a three-week long operation in the Achin and Shinwar districts of Nangarhar.
Operations against the militants included airstrikes to destroy militant hideouts and a radio station that was broadcasting Daesh recruitment messages across Nangarhar Province.
Afghan forces say they have killed at least 200 militants in the offensive across the troubled region.
Afghan Army Lt. Col. Sharin Aqa, a military spokesman, has said that the operation was aided by local residents who set up checkpoints to help maintain security in their villages.
"The aim of the operation in Nangarhar was to root out IS (Daesh) from the area," he said.
Achin and Shinwar are among a number of districts in the remote mountainous regions that were overtaken by Daesh loyalists in recent months.
Daesh has recently gained a foothold in Afghanistan, particularly in Nangarhar Province bordering Pakistan.
Afghanistan, parts of which have long been considered a bastion of Taliban, has recently been seeing the emergence and limited expansion of Daesh. Nangarhar, in particular, is one area where Daesh has visibly gained a foothold.