A suicide bombing at an election rally killed at least 12 people, including a prominent local politician, and injured 36 others in northwestern Pakistan on Tuesday, police said.

The attack targeted a campaign event organised in the city of Peshawar by the Awami National Party, which has been targeted by Islamist militants in the past over its vocal opposition to extremist groups like the Taliban.

The bombing came hours after the Pakistan military spokesman said there were security threats ahead of national elections scheduled for July 25.

"According to our initial investigation, it was a suicide attack and Haroon Bilour... was the target," police official Shafqat Malik told AFP, referring to one of the ANP's candidates for the elections.

Another senior police official Kaukab Farooqi confirmed that the blast killed Bilour and injured 36 others.