The Taliban has attacked an army post in Afghanistan’s western province of Farah, killing at least eight Afghan soldiers, officials say.

The overnight assault lasted nearly three hours before the militants overran the outpost and took nine other soldiers hostage, council members Dadullah Qani and Gul Ahmad Faqiri said on December 9.

They said the attackers took all of the post's equipment with them.

Provincial police spokesman Mohibullah Mohib said three militants were also killed and four others were wounded in the battle.

Taliban spokesman Qari Yousof Ahmadi posted a video on Twitter showing what he said were the captured soldiers.

The Taliban has ramped up attacks on Afghan security forces and government facilities in recent months.

Based on reporting by AP and dpa