The Taliban believed Beyar Khan Weyaar was the perfect candidate to prepare an insider attack on Afghan police, but instead he set a daring trap that has given a rare insight into suicide bombing tactics.
Weyaar, a low-ranking police officer in the eastern province of Paktika, was approached in November by a man who offered him the chance to get rich if he met a local insurgent commander.
"I thought he was joking," Weyaar told AFP after collecting a hero's medal from Interior Minister Mujtaba Patang in Kabul on December 25.
"But the commander, who said he was called Mohammed, came to meet me at my police post in Sar Hawza district. He must have known I worked there.
"He brazenly asked me to take the Taliban side and help them launch an attack inside the police force. I asked him to give me time to think."
Weyaar, aged in his early 40s, instead informed senior officers, who gave him clearance to continue meeting the insurgents to gain intelligence.
He then got a telephone call from a leader of the Taliban-linked Haqqani group offering him a luxury house in Pakistan if he helped bombers infiltrate the Paktika provincial headquarters where the governor and police chief work.
Though impossible to verify, Weyaar and government officials believe the caller was Sirajuddin Haqqani, chief of the Haqqani network, a group close to Al-Qaeda that is blamed for some of the most deadly insurgent attacks.
"He said he would give me 2.5 million Afghani ($50,000), two brand new cars and a house in Pakistan," Weyaar said.
The police decided to go along with the plot and signed up three men aged 18-25 who were sent by Mohammed. They were taken on as junior recruits, given police uniforms and started work in Weyaar's post.
"We were watching this very closely. We told Weyaar to cooperate with them and be careful to not give himself away," Mohibullah Samim, the governor of Paktika, told AFP.
"He is a true warrior and he was not worried about his own security. We trusted him, and he proved himself to be a brave patriot."
About a month later, Mohammed returned to launch the attack. He was with two more people, a pick-up truck packed with explosives, and had 60 hand grenades, six machine guns and six suicide vests.
"I asked him about the sixth suicide bomber that he had told me would take part," Weyaar said. "He said, 'The sixth person is me, I will detonate the vehicle.'"
On December 11, the day of the planned attack, Weyaar was told his role was to ensure the attackers and the bomb-laden truck were separately allowed into the government compound where he had security clearance.
He would then be free to escape and head into Pakistan, which borders Paktika.
Police let the plan unfold until just before the suicide attack was set to be launched -- a potentially huge strike in the strategically important province.
Commanding officers, who had positioned reinforcements in hiding spots, sprung the trap, and police swooped in to arrest all six men as they gathered near the compound, without a shot being fired.
Realising he had been tricked, Mohammed shouted at Weyaar: "Now that you deceived us, why don't you just shoot me yourself?" He was then led away in handcuffs.
Insider attacks have surged in Afghanistan this year, with at least 60 foreign troops and many more local personnel killed, severely undermining US-led efforts to work with the Afghan army and police.
Last week a policeman let Taliban gunmen into a post in Uruzgan province before dawn, where they killed four of his sleeping colleagues and in Kabul a female police officer shot dead a US adviser.
The thwarted attack in Paktika provided valuable information on how militants try to recruit insiders and how they plan attacks weeks or months in advance.
US special forces in September suspended training for around 1,000 Afghan local police recruits to investigate current members for insurgent links -- though most attacks are thought to be driven by personal animosity.
Weyaar's tale of trickery and nerve has been corroborated by the interior ministry in Kabul, the Paktika provincial governor and its police chief Dawlat Khan Zadran.
Weyaar collected his medal and a cash reward in Kabul on Tuesday and also appeared on television news programmes to recount how he turned the tables on the Taliban and its Haqqani associates.
The NATO-led coalition confirmed to AFP that it had detonated the attackers' vehicle, explosives and suicide vests after the failed plot in the village of Sultani.
Since the attack was foiled, Weyaar said he received several death threats from Pakistan-based militant commanders furious that he had deceived them.
"I told them I'm not scared of you. I'm a fighter," he said.