The militants were killed when the police returned fire in a raid in the Khanewal district, said Chaudhry Mohammad Saleem, the official.
He said the militants were from Jamat-ul-Ahrar, a breakaway faction of the Pakistani Taliban.
The faction has also expressed support for the Islamic State group but has not pledged allegiance to it.
Hand grenades, assault rifles and a cache of explosives were seized in the raid, Saleem said, adding that three other suspects managed to escape from the scene.
More From This Section
Earlier in the day, a roadside bombing wounded four Pakistani paramilitary troops in the southwestern district of Mastung, which was the site of a deadly IS attack last week.
In Monday's attack, a roadside bomb struck the troops' vehicle, police official Abdul Nabi said.
Sunni extremist group Lashkar-e-Jhangvi claimed responsibility for the attack. Lashker-e-Jhangvi claimed a similar attack on Sunday that wounded two paramilitary troops.