KABUL, Afghanistan — Afghan security forces battling the Taliban about 30 miles west of Kabul have sustained heavy casualties, officials said Saturday, as senior members of the government criticized the response to the assault as slow and ineffective.

Details of the fighting in Wardak Province, which began Thursday, were murky, but statements by various officials said that 16 to 30 members of the Afghan Local Police, a militia controlled by the Interior Ministry, had been killed, along with at least two civilians. Some of the dead were decapitated, officials said.

Mr. Ghani, in a statement, said “the desecration” of the bodies was a “war crime.”

The ugly turn in the war comes as Afghanistan’s struggling coalition government remains without a minister of defense 10 months after taking office. President Ashraf Ghani’s third nomination for the post was rejected by Parliament on Saturday.

The fighting was taking place in the province’s Jalrez district, which lies on a strategically important highway connecting Kabul, the capital, to the central province of Bamian. The highway was closed Saturday, said Masood Shneezai, deputy chief of Wardak’s provincial council.