The diplomat, Heshmatollah Attarzadeh, who was working as commercial attache in Iran's consulate in Peshawar, was freed 'in a complicated intelligence operation', Iranian state-run television said on Tuesday.
'Iranian intelligence agents... managed to release Atharzadeh and bring him home,' it said.
The television did not give information when, how and where the operation had been carried out.
This is the second time in recent months that Iranian Special Forces have carried out such an operation. In February, they arrested one of the most wanted Baloch Sunni militants, Abdolmalek Rigi, who was believed to have been staying in Pakistan and launching attacks against Iran from this country.
Rigi, the chief of the rebel group Jundallah or Soldiers of God, was captured after Iranian warplanes reportedly forced a flight from Dubai to Kyrgyzstan to land in Iran.
Iranian Intelligence Minister Heidar Moslehi charged that an armed group backed by the US and Israel's intelligence agency Mossad had abducted the diplomat. He said Iranian government had sought Pakistan's help to get him freed.
"After the Pakistani government failed to do so, Iranian intelligence took the initiative and managed to release Atharzadeh," Moslehi said.
The minister claimed that the release of the diplomat had proved that Iran's intelligence services outperformed others in the region. Armed men had abducted Atharzadeh after killing his bodyguard as the diplomat was driving from home to the Iranian consulate in Peshawar on November 13, 2008.
There was no word from the Pakistan government on Atharzadeh's rescue by Iranian agents. Afghanistan's Ambassador-designate to Pakistan, Abdul Khaleq Farahi, was kidnapped in Peshawar about two months before Atharzadeh.
His whereabouts are still not known, though it is believed that the Pakistani Taliban is holding him.
Photograph: Morteza Nikoubazl/Reuters
Sanctions against Iran no solution, says India
Why March 26 should be apology day for Pakistan
Pak 'satisfied' despite US' snub over nuke deal
Iran to execute student for throwing a stone
Afghanistan ready to play ODI series in Pakistan