Two security guards have been killed and more than a dozen people wounded in a suicide bombing outside the Iranian consulate in Peshawar in northwest Pakistan, police have said.

Monday's attack was in an area housing offices of foreign diplomatic missions and non-governmental organisations in the sprawling city on the Afghan border .

"It was a suicide blast. A man walked up to the checkpost outside the foreign mission after parking his car nearby. The man blew himself up when he was stopped by security men," a local police officer told Reuters news agency.

The wounded were taken to hospital where the condition of five was serious.

A spokesman for Mast Gul, once acclaimed in Pakistan for his role fighting Indian rule in Kashmir, claimed to be behind the attack. Gul is linked to an armed group affiliated with the Pakistani Taliban, who are fighting to topple the government.

"We sent a suicide bomber to target the Iranian consulate and Iranians inside the building," the spokesman said.

"They unfortunately remained safe. We will continue to target Iranian installations and the Shia community everywhere," he added.

The attack on the Iranian consulate came as the government of Prime Minister Nawaz Sharif tries to engage the Taliban in peace talks. Negotiations broke down this month after a string of attacks and counter-attacks by both sides.

Iran is Pakistan's predominantly Shia Muslim neighbour to the west. Radical Sunni militants frequently attacks Shia targets and mosques in Pakistan, describing minority Shias as infidels to be exterminated.

Shia Pakistani pilgrims are often attacked as they travel across the country to visit holy Shia sites in Iran.