Acting on a tip-off, the police raided a house in Karachi's Sachal Goth area where the militants were holed up, senior official Rao Anwar said.
During the raid, the militants started firing to which the police retaliated. The six militants were killed in the cross-fire, Anwar added.
He said the militants were planning to carry out a major terror attack during Muharram but police aided by intelligence agencies foiled their bid.
Explosives, hand grenades and suicide vests were also seized from the possession of the militants.