The attack lasted an hour and when rescuers approached the scene the gunmen also attacked them, according to Khan Faraz, an official in the Jamrud area of Khyber, a rugged tribal region bordering Afghanistan. (Agencies)
Around a dozen wounded were taken to hospital, but others died on the road waiting for help to arrive, he said.
Another official, Assistant Political Agent Jehangir Azam, said all the casualties were members of the levies or Khasadar, both locally recruited government-backed militias. They were providing security for the health workers.
Polio vaccination teams are frequently attacked, as are government security forces. A spokeswoman for UNICEF said it was unclear who the target was on this occasion.
Some religious leaders have denounced the multi-billion dollar vaccination campaign as a cover for spying or a plot to secretly sterilise Muslim children.
Pakistan is one of the last three countries in the world where polio remains endemic and the only one of those three where reported cases are increasing. The disease can kill or paralyse within hours.
In a separate incident in western Baluchistan province, a roadside bomb killed three members of a government paramilitary force in Sorab, about 230 kilometers southwest of the provincial capital of Quetta.
Shortly afterwards, the paramilitary Frontier Corps announced it had killed ten men in Sui, 300 kilometers southeast of Quetta. The Frontier Corps said they were carrying out an operation to search for militants who had bombed gas pipelines.
Baluchistan, a mineral-rich and dirt-poor province, is home to a bloody separatist insurgency, other militant groups, drug lords and government-backed death squads.
In recent weeks the Pakistani government tried to initiate peace talks with the Taliban insurgency, an umbrella group of militant factions and the largest and deadliest of dozens of militant groups operating in Pakistan.
But peace talks failed after the Taliban bombed a bus of policemen and a faction of the Taliban claimed to have executed 23 kidnapped men from a government-run paramilitary force. Their bodies were never found.
The Pakistani military responded by bombing areas they identified as militant hideouts. A military spokesman says the attacks destroyed key hideouts and killed dozens of militants.
The air operations have sparked speculation that a much-anticipated offensive may finally be launched in North Waziristan, a tribal area along the border with Afghanistan that is considered the Taliban's main stronghold.
The attack lasted an hour and when rescuers approached the scene the gunmen also attacked them, according to Khan Faraz, an official in the Jamrud area of Khyber, a rugged tribal region bordering Afghanistan.