The men were arrested in the Qarghayi district of northeastern Laghman province on Sunday, just 150 feet from where Khalilzad had planned to inaugurate a road along with Afghanistan's interior minister, chief presidential spokesman Jawed Ludin told The Associated Press.
Two senior Afghan officials said the men had confessed to their crimes and said they were in Afghanistan "to fight jihad."
"Their aim was to assassinate Khalilzad, and they came to Afghanistan specifically for this operation," said one of the officials, both of whom spoke on condition of anonymity due to the extreme sensitivity of the intelligence and their positions within the government.
Afghan television later broadcast a video of the suspects in custody. The men, all young and with thin mustaches, are seen sitting together on a brown sofa being questioned by a man off camera. They identified themselves as Murat Khan, Noor Alam, and Zahid and say they are from Pakistan. None confessed on camera or were asked any questions about the attack.
U.S. Embassy spokesman Lou Fintor declined to comment on the arrests, referring all questions to Afghan authorities.
Khalilzad, who is to be the next American ambassador in Iraq, canceled his appearance at the road opening at the last minute and was never in danger, the Afghan official said. Interior Minister Ali Ahmad Jalali also canceled his appearance.
The official said the fact the plotters knew of Khalilzad's trip, and that Jalali was supposed to be with him, was "very disturbing."
"We don't know how they got this information," he said.
It was not clear who had sent the men. One of the officials said the Afghan government was extremely angry at what he called a "lack of cooperation" from Islamabad in stopping militants from crossing the border.
He said Pakistan's lack of resolve was a factor in both the assassination plot, and a recent upsurge in violence across southern Afghanistan that has left hundreds dead.
"We have always believed that if we got cooperation from Pakistan, this violence wouldn't be happening," he said. "These militants are getting support from people in Pakistan, and we are not convinced when Islamabad says it can't control them."
Pakistani Information Minister Sheikh Rashid Ahmed reacted angrily to any hint of official sanction for the attack.
"This is a baseless allegation," he told AP. "Pakistan is not involved in any such thing now or in the past."