He said the Taliban would investigate the attack and “then I will comment and say who was behind it.”

Mr. Ghani did not elaborate on his statement that the Islamic State had taken responsibility for the Jalalabad attack, and it was not clear where he had obtained that information. Pahjwok News, an Afghan news agency, reported that a former Pakistani Taliban figure named Shahidullah Shahid said ISIS had claimed responsibility for the attack. But there was no confirmation that Mr. Shahid spoke for the group, whose nearest confirmed base of operations is 1,500 miles to the west, in Iraq.

There have been reports of ISIS recruiting activities in Afghanistan, especially in the southern part of the country. But the bombing on Saturday was the first instance of a significant terrorist attack said to be claimed by the group anywhere in eastern Afghanistan. Jalalabad is only about 60 miles from the national capital, Kabul.

American military officials have expressed alarm about reports of attempts by the Islamic State to make inroads in Afghanistan through taking advantage of splits in the Taliban ranks. There is also discontent over the fact that even most Taliban commanders have not seen the reclusive Taliban leader, Mullah Muhammad Omar, in many years.

In February, an American drone strike in southern Helmand Province killed a former Taliban commander, Mullah Abdul Rauf Khadim, who claimed to have switched his allegiance to ISIS.

Reports were circulating on social media in Afghanistan on Saturday showing a photograph said to be of the Jalalabad suicide bomber before the attack. He was dressed in Afghan-style clothing, with a crude, handmade ISIS flag behind him. The authenticity of the photograph could not be immediately confirmed.

Local Afghan journalists in Jalalabad said they had received an anonymous text signed by Wilayat Khorasan, a group claiming to be an ISIS affiliate in Pakistan and Afghanistan, and claiming responsibility for the bombing immediately after it happened Saturday morning. The text was signed by Mr. Shahid but was sent via an unknown cellphone number, and attempts by journalists to reach Mr. Shahid at a verified number were unsuccessful.