AFGHANISTAN'S Taliban militants have decried a pact by rival election candidates to form a government of national unity as a "sham" orchestrated by the US, and they vowed to press on with their war.

Former finance minister Ashraf Ghani was named president-elect on Sunday after he signed a deal to share power with his opponent, former foreign minister Abdullah Abdullah, ending months of turmoil that has destabilised the country as most foreign troops prepare to leave.

Mr Ghani's administration must now not only forge an effective government after so much acrimony, amid doubts about how long the pact will last, but must also deal with an emboldened Taliban insurgency.

The Taliban have been fighting to oust US-led foreign forces and their spokesman, Zabihullah Mujahid, rejected the national unity government pact as an unacceptable ploy orchestrated by their enemy.

He said: "Installing Ashraf Ghani and forming a bogus administration will never be acceptable to the Afghans.

"The Americans must understand our soil and land belong to us and all decisions and agreements are made by Afghans, not by the US foreign secretary or ambassador."

The Taliban ruled Afghanistan with their extreme interpretation of sharia law for five years before being toppled in 2001.