Washington- ISIS is operating inside Afghanistan and eyeing the country as a strategic foothold in its broader war to establish a caliphate in the Middle East, Afghan President Ashraf Ghani sources.

In an interview, Ghani said that Afghanistan has evidence ISIS is organizing inside the country.

"Fortunately, we've prevented them from acting," Ghani told NBC News' Andrea Mitchell. "But we have sufficient evidence that they were targeting us because to their narrative, to their story line, Afghanistan is central."

Ghani said that ISIS sees Afghanistan as strategic, because in the extremist group's mythology, a final battle against Islamic State forces will be waged in Syria by a force from Afghanistan. The threat of ISIS attacks on Afghan soil comes as around 7,000 U.S. troops still in the country as part of a NATO-led training and advisory force are scheduled to begin withdrawing.

When pressed on whether he would push President Barack Obama to keep U.S. troops in Afghanistan longer, Ghani said, "We need to examine the situation together, reach a common understanding, and on the basis of that, make decisions on those critical questions."

Ghani said his first U.S. visit since taking office in September was intended to thank the U.S. for its commitment to Afghanistan — the 13-year military engagement makes the fight against the Taliban and Al Qaeda the U.S.'s longest war.

"Over 2,000 American servicemen and women have lost their lives, over 20,000 have been wounded in action, and the people of Afghanistan want to say thank you."