Those killed during a raid belonged to the outlawed sectarian Lashkar-e-Jhangvi group, which has links with the Pakistani Taliban and routinely claims responsibility for attacks on Shias, reports Xinhua.
The suspects started firing on the raiding police party at Karachi's Mauripur area, injuring three officers, Senior Superintendent of Police Chaudhry Aslam told reporters.
He said the police launched a search operation following a tip-off that the suspects had been hiding in a compound and planned attacks in the city.
"As the police party arrived at the scene, the armed militants opened fire," he said.
The police officers returned fire, killed six militants and recovered arms and suicide vests. Three police officers were also injured, the Crime Investigation Department said.
The militants killed include Gul Hasan, who was involved in over 50 cases of sectarian killings in Karachi, a police officer said.
He said the suspected militants were believed to be involved in the attacks on a high court judge and a Shia worship place.
Police officer Aslam said the militants were planning to target a main mosque of the Shia Muslims in Karachi prior to the religious gatherings Thursday and Friday.
Shia Muslims are set to hold processions on the ninth day of the holy Muslim month of Muharram to mourn the seventh century martyrdom of Imam Hussain, the grandson of Prophet Mohammad, along with his family members in Karbala.