It is rare that assailants in such attacks are detained. Afghan officials hoped the men in their custody, as well as the communication equipment seized, will help bring clarity to whether recent urban attacks claimed by the Islamic State can be traced to the same networks that operate for the Taliban and the Haqqani Network, the lethal arm of the insurgency.

“If they are thinking the rocket attack will keep Afghans down, they are wrong,” Mr. Ghani said.

Since a rare, overlapping cease-fire two months ago brought Afghans a brief bit of quiet, Mr. Ghani and his international partners have been working toward a second lull in the fighting around Eid al-Adha. When the Taliban assaulted a major city just 90 miles from Kabul, it put the fate of a second cease-fire in limbo. Mr. Ghani went ahead with an offer, but this time conditioned it on the group’s reciprocating.

The Taliban have remained quiet on the offer. Instead, they abducted more than 100 Afghans on the highway in the north of the country on Monday. By the end of the day, they had released most, except for 21 who were reportedly members of security or government forces.

In private, Taliban officials said they were unlikely to declare a cease-fire this time, largely because it had been difficult to contain their fighters during the last one. Many of them even traveled to cities and took part in celebrations, suggesting to the Afghan government that the insurgents are as tired of the war as officials are.

In recent months, a strong push has been made to end the Afghan conflict by getting the Taliban to the negotiating table. American diplomats met with Taliban officials in the Persian Gulf state of Qatar, where the insurgents keep a political office, in the hopes of shifting their long-held condition that they would negotiate only with the Americans first.

Now, Moscow is increasing its own involvement, and it has reached out to the Taliban.

“We have never concealed the fact that we maintain contacts with Taliban members — they are part of Afghan society,” said Mr. Lavrov, the Russian foreign minister, at news conference in the southern Russian resort city of Sochi.

The Taliban rejected a similar invitation to talks in April 2017, according to Russian news media reports.