KABUL, Afghanistan (AP) — The Taliban targeted military posts in two western Afghan provinces and in the country's south, killing 13 soldiers and setting off hours-long gunbattles with the military, officials said Wednesday.

In one attack, in western Farah province, the insurgents stormed a security post, killing nine troops and wounding four. The attack took place on Tuesday night in Pusht Road district, said spokesman Mohammad Naser Mehri.

An intense, four-hour gunbattle followed in which the militants used artillery against the army, Mehri said. Afghan warplanes were deployed and 17 Taliban fighters were killed, he added.

The second attack took place in neighboring Herat province, also Tuesday night, at an army post in Kushki Kuhna district where two soldiers died and five were wounded, according to Najibullah Najibi, the military spokesman in Herat.

The attack lasted several hours until the army pushed back the Taliban, Najibi said. He added that the Taliban suffered "heavy casualties" but did not provide a figure.

And in southern Uruzgan province, the Taliban hit an army post in Chura district, also on Tuesday night, killing two soldiers and wounding six others, said district governor Aminullah Khailqi.

Before fleeing the scene, the Taliban seized all the arms and ammunitions, Khaliqi said.

There was no immediate comment from the Taliban on the attacks Tuesday night but insurgents have stepped attacks all across Afghanistan, with the last two weeks being particularly deadly for Afghan forces.

Last Thursday, a Taliban attack on a military compound left 43 soldiers dead in southern Kandahar province, a Taliban heartland.

Meanwhile, Afghan officials also reported intense clashes on Monday and Tuesday in northern Jawzjan province between Taliban fighters and rival militants from an Islamic State affiliate that emerged in recent years in Afghanistan.

According to Faqir Mohammad Jawzjani, the provincial chief of police, the fighting left six Islamic State militants and 42 Taliban fighters dead.

Jawzjani said the IS launched an attack on Taliban positions in several locations, capturing several areas and villages from the Taliban in two districts. He estimated that the number of IS fighters in the two districts — Khush Tipa and Darzab — is about 400.

___

Associated Press Writer Mirwais Khan in Kandahar, Afghanistan, contributed to this report.