At least one bombing was attributed to the Islamic State, the extremist group also known as ISIS, according to Afghan officials.

A spokesman for the Taliban said the insurgents had not played any role in the attacks.

In the Kabul attack, a bomb was detonated in the parking area of the Ministry of Rural Development about 1 p.m. Monday, a ministry spokesman, Mohammad Daud Naeemi, said. It was unclear if the explosive was delivered by a suicide bomber in a car or on foot. Seventeen people were killed and 40 were wounded, said Wahidullah Majroh, a spokesman for the Ministry of Public Health.

In eastern Nangarhar Province, three suicide attackers struck at the Education Ministry’s offices in the provincial capital, Jalalabad, but the police had been warned they were coming. Two attackers who wore suicide vests were shot and killed before they could do significant damage; the third was driving a car loaded with explosives that failed to detonate. No one else was killed, but 15 people were wounded, according to Ghulam Sanai Stanikzai, the Nangarhar police chief.