The official also said three other militants had been arrested Sunday for allegedly planning the assassination of Afghan Vice President Mohammed Karim Khalili, the Los Angeles Times reported.
The five men confessed they had planned a terrorist attack in Kabul, said Shafiqullah Tahiry, a spokesman for Afghanistan's national director for security.
He said of the five men arrested with explosives, three were members of the Pakistani Taliban, the other two, members of the Afghan Taliban.
Tahiry did not say what the militants planned to target with the explosives nor when the arrests took place.
"Imagine if [10 tons] of explosives, which was already inside Kabul" had exploded, "what a disaster could have happened," Tahiry said.
The explosives were in 400 bags and hidden under potatoes in a truck with Pakistani license plates, Tahiry said.
Coordinated attacks in three parts of Kabul and in three other cities Sunday killed eight police officers and three civilians as well as 36 militants, Afghan officials said.
Tahiry said the men arrested Sunday in the alleged assassination plot were part of the Haqqani network and planned to kill Khalili at his home. They had been equipped with suicide vests and small arms, officials said.
Ebola health workers killed in Guinea