In a BBC interview, Ghani said IS was "not an Afghan phenomenon" and its atrocities had "alienated the people."

"Afghans are now motivated by revenge," he said. "They [IS] have confronted the wrong people."

In other comments, Ghani warned that if peace talks with the Taliban did not start by April the conflict would intensify, with consequences across the region.

"Time is not a friend," he said. "We all understand that February and March are crucial."

The Afghan president said observers should understand that the war in his country was "just one component" of a wider war that also encompassed Pakistan.

"The problems... are interrelated [and] cannot be solved by use of force in one country.

He suggested Pakistan should take action against Taliban groups that did not agree to talks.

"We need to see that we have common interests and we need to act together to preserve the state system and consolidate it," he said.

Asked what message he had for Afghan migrants arriving in Europe, Ghani said: "What I say to them is that you have no future in Europe. Europe is shutting down its borders."