Thousands flocked to the funeral Wednesday of a politician killed by a Taliban suicide bomber in northwestern Pakistan's Peshawar, hours after the explosion left 20 dead in the first major attack ahead of July 25 polls.

Five other people were injured in the incident, which occurred in the city of Peshawar as the Additional Inspector General for Khyber Pakhtunkhwa province, Ashraf Noor, and his guard were travelling to work.

Three Pakistani soldiers were killed in an ambush in the northwestern city of Peshawar on Sunday, militants said, in an attack for which both Islamic State and a Pakistani Taliban faction claimed responsibility.