Taliban fighters have overrun two district centres in northern and central Afghanistan, as Afghan forces fight to contain a growing rebellion across the country.

Ghor's Taywara district fell to the Taliban early on Sunday after several days of clashes with Afghan security forces, Mohammad Mahdavi, deputy chief of the provincial council for Ghor, told DPA news agency.

The central province of Ghor shares borders with two insecure provinces, Farah in the northwest and Helmand in the south, both of which are known as strongholds for Taliban fighters, Mahdavi said.

READ MORE: US air raid kills Afghan police in Helmand

Another district in northwest Faryab province also fell to the Taliban early on Sunday.

"A large number of Taliban [attacked] Kohistan district centre from several directions around 9pm on Saturday," said Javed Bedar, a spokesman for the Faryab governor.

According to Bedar, both security forces and the Taliban suffered casualties, but no exact numbers were immediately available.

The Taliban launched four assaults on Ghor's Taywara police headquarters and "we had no choice but to retreat," provincial police chief Mohammad Mustafa Moseni said.

He said police have taken up positions about 8km from the headquarters while they wait for reinforcements to launch a counterattack.

Taliban spokesman Zabihullah Mujahid confirmed that the fighters had captured both Taywara and Kohistan district centres and said the group had killed scores of Afghan security forces and captured of a large amount of weapons.

READ MORE: Rejected asylum - From Karachi to Germany and back again

In Faryab's Lawlash district, two police officers were killed late on Saturday when Taliban used the cover of darkness to attack and set fire to the police headquarters buildings, Abdul Karim Yourish, the provincial police chief spokesman, said.

There has been a surge in fighting in several northern and southern Afghan provinces in recent days, including in Helmand in the south where 16 Afghan police officers were killed by a US air raid on Friday night.

The attack, the latest setback in Washington's efforts to pacify the country, hit a compound in Gereshk district, large parts of which are under Taliban control.

Afghan troops and police are battling largely alone on the ground against the anti-government forces, after US-led foreign forces withdrew from most combat operations in December 2014.

The United States is actively considering sending more troops to Afghanistan and US commanders there have requested thousands of extra soldiers on the ground.

The US contingent now numbers about 8,400, and there are another 5,000 from NATO allies, a far cry from the US presence of more than 100,000 six years ago. They mainly serve as trainers and advisers.