KABUL (Reuters) - Afghan forces on Wednesday reasserted control over the western city of Farah after a Taliban assault a day earlier but there was heavy fighting elsewhere, including Ghazni, south of the capital, Kabul, officials said.

Residents look at an Army vehicle which was damaged during battle between Afghan security forces and Taliban in Farah province, Afghanistan May 16, 2018. REUTERS/Stringer

With security heightened to protect preparations for elections in October, the fighting underlined the problems faced by President Ashraf Ghani’s government, which has struggled to rein in the insurgency in the provinces and ensure security against suicide attacks in Kabul.

Afghan and U.S. officials said the Taliban fighters who attacked Farah on Tuesday had been driven out, but officials in Ghazni, on the other side of the country, said the insurgents were attacking in three districts and a key highway link, blocked for almost two weeks, remained severed.

Since the Taliban announced the start of their annual spring offensive last month, they have seized or threatened district centers in Baghlan and Badakhshan provinces in the northeast, Faryab in the northwest and Ghazni and Zabul south of Kabul.

Fighters overran a number of areas in Tuesday’s early morning assault on Farah, raising fears of a repeat of their capture of the northern city of Kunduz in 2015.

On Wednesday, defense ministry spokesman Mohammad Radmanish said Farah was completely under government control, with some fighting continuing in outlying areas, though the city still bore the scars of Tuesday’s fierce fighting.

“The Taliban burnt parts of the headquarters of the National Directorate of Security and the customs office, and according to my information, they reached the central provincial prison as well,” said Farid Haibat, a Farah civil activist.

Afghan forces were backed by U.S. air power and several drone strikes were conducted overnight but the Taliban denied having been pushed back, saying fighters pulled out after achieving their objectives of creating shock and capturing weapons and equipment.

“Without any disturbance, the mujahideen withdrew to their safe positions,” Qari Yousuf Ahmadi said in a statement, employing a term the Taliban uses for its fighters.

In Ghazni, where Taliban fighters have cut a key highway link with the neighboring province of Paktia for the past two weeks, fighters pressed a number of district centers.

Taliban fighters attacked the district of Zanakhan, just north of the city, district governor Zia Yaqoubi said, killing 13 police on Tuesday and capturing weapons and ammunition. The districts of Gero and Andar to the southeast were also attacked.

“There is no way of supplying Andar by road, so it has to be supplied by air,” said provincial council member Ahmad Faqiri. “If the district doesn’t get supplies and reinforcements, there will be a disaster.”