Afghan Shiite mourners and relatives attend a burial ceremony for the 35 victims of a suicide attack in a Shiite mosque in Gardez, in Paktia province, on Saturday. (Farid Zahir/AFP/Getty Images)

A midwife training center. A refugee assistance office. A cricket match. A convoy of Sikh and Hindu leaders. A customs building. An elementary school. A cease-fire celebration. And on Friday, a crowded prayer service in a Shiite mosque.

The fast-growing list of recent terrorist attacks in eastern Afghanistan, mostly suicide bombings claimed by the Islamic State, represent a gruesome array of what experts call “soft targets.” The victims have been mostly civilians, the sites benign and lightly guarded, and the tolls of dead and wounded high.

On Sunday, though, a suicide bomber killed three foreign soldiers, identified as Czechs, who were on a foot patrol near Bagram air base in eastern Afghanistan. One American soldier and two Afghan troops were wounded in the incident.

Since January, when an office of Save the Children, a British charity, was attacked in Jalalabad, the pace of assaults has increased steadily. By late July, with more than 200 people killed in a dozen attacks, officials finally called in Afghan National Army troops to protect the prosperous, panic-stricken trading hub near the Pakistan border.

At a time when hopes for reconciliation with Taliban insurgents have been bolstered by a successful cease-fire in June and a reported meeting last month between U.S. officials and Taliban representatives in Qatar, the surge of attacks by the regional branch of the Islamic State extremist militia, known to Afghans as Daesh, has stood in sharp, ominous contrast to that progress.

It has also come as the jittery nation prepares for parliamentary elections in October and as Afghan officials have announced that a presidential election will be held next April. Security at the polls is by far the top concern among officials, and continued terrorist attacks could prevent people from voting or force polls to close in several regions of the country. Between 1,500 and 2,000 Daesh fighters are said to be active in Afghanistan.

“Daesh does not have any plan to win the hearts and minds of people, but to show that the government is weak and that it cannot stop these attacks,” said Javed Kohistani, a retired army general. He said the main goal of the relentless bombings, especially deep inside cities such as Jalalabad, is to “frighten people . . . and make them stop trusting the government security forces.”

Afghan security officials said the group’s new focus on civilian targets in cities and towns, especially those near its base close to the border with Pakistan, is a result of sustained battlefield losses. American Special Operations forces and their Afghan counterparts have been waging a joint counterterrorism campaign against the Islamic State, mostly in the east, and officials said the campaign has had significant success. But, they said, that has driven the group to seek out softer targets.

In late June, Afghan officials said Islamic State leader Adam Khan, who they said had planned recent attacks in Jalalabad, was killed in a raid by the national intelligence agency in the rural Chaparhar district of Nangahar province. Officials said Khan was behind attacks on the Jalalabad cricket field, medical school, education department and customs facility. 

And last week, officials said about 150 Islamic State fighters and loyalists, including 30 women and children, surrendered in northeastern Jowzjan province after weeks of intense fighting with Afghan army troops. However, Taliban insurgents also took credit for the mass surrender, claiming that their fighters had killed more than 150 Islamic State forces and captured 130.

The two insurgent groups have been fighting turf wars for the past several years, and the unexpected success of the mid-June cease-fire between the Taliban and the Afghan government sparked violent retaliation in Nangahar by the Islamic State, which bombed two gatherings during the truce that included local elders, Taliban commanders and Afghan security forces. 

Afghan military officials called the Jowzjan surrender a “turning point” in the conflict with the Islamic State, noting that two of its senior leaders were among those who turned themselves in. “With this, the Daesh chapter is going to be closed in the north,” an army spokesman said.

But on Friday, a bomb tore through a crowded prayer service of Shiite Muslims in Gardez, the capital city of eastern Paktia province. More than 30 worshipers were killed, and scores were injured. It was claimed Sunday by the Islamic State, which views Shiites as infidels and has claimed numerous previous attacks on Shiite targets.

“Daesh has no roots here and cannot flourish here because the tribes are ideologically against it,” Abdullah Hasrat, a spokesman for the Paktia governor, said Saturday.

“Daesh only spreads hatred and killing,” he said. “Whoever did this, it was for the purpose of creating divisions among the people, tribes and sects.”

Meanwhile, the fearful mood in Jalalabad has calmed somewhat with the presence of hundreds of armed troops at checkpoints on major streets. Ataullah Khogyani, a spokesman for the Nangahar governor, said Saturday that the Islamic State has resorted to urban attacks “due to a series of defeats and losses” in rural battles. “They want to create terror and fear, but we will not allow them to win,” he said. 

But a variety of communities have been shattered by attacks, especially two that occurred on June 30 and July 1. First, insurgents set fire to a boys school in the Khogiani district and beheaded three security guards there; the next day they bombed a convoy of minority Sikh and Hindu leaders en route to a meeting with Afghan President Ashraf Ghani, killing 20 people.

Sikhs and Hindus have had a historic presence in Nangahar, mostly as traders and merchants, but their numbers declined drastically during years of conflict and Taliban rule. Now, they have begun to regroup and participate in politics. Among those killed was Awtar Singh Khalsa, a first-ever Sikh candidate for parliament. 

“This was a big shock for all of us. It was the bloodiest incident ever for our community,” said Narendar Singh, an aide to one of the slain Sikh leaders. “We have not decided whether to stay or leave. Our kids are going to school as normal, and we have to continue our lives, but we are utterly shaken.”