Gunmen in eastern Afghanistan have killed at least 13 people in a midnight attack on a highway as at least nine militants died in a suspected US drone strike near Pakistan.

The highway attack happened in Wardak province's Sayad Abad district, where Taliban fighters hold much territory and launch frequent attacks on security forces. However, no group immediately claimed responsibility for the assault, which comes after several recent attacks targeting buses in the country.

The gunmen opened fire on three separate vehicles in the attack, including a bus travelling from Kabul and heading to Ghazni province, said Attahullah Khogyani, a spokesman for the provincial governor. He gave the death toll and said the gunfire wounded at least two civilians.

The attack came as Afghan president Ashraf Ghani continues his visit to the US where he pledged his country will "put its house in order".

Last month, gunmen in southern Afghanistan kidnapped 30 members of the Hazara ethnic community travelling on a highway in Zabul province. Security forces have been trying to secure their release ever since the attack, the latest to target Shiites in the predominantly Sunni country.

Meanwhile, two intelligence officials in Pakistan said the suspected US drone strike in Afghanistan's Nangarhar province killed at least nine militants from the Pakistani terror group Lashkar-e-Islam. The group recently announced it would join forces with the Pakistani Taliban to fight government forces in that country.

It was not immediately possible to corroborate the officials' claims about the strike in the rural, mountainous region. Drone strikes have killed civilians in the region in the past.

US officials rarely discuss their drone strikes in Afghanistan and Pakistan as many are run by the CIA. Afghan forces have taken the lead in securing their country after US and Nato troops formally ended their combat missions in the country at the start of this year.