The Tehreek-e-Taliban militants were killed in a poor neighbourhood of Gulshan-e-Buner in the Mangopir area, senior police official Rao Anwar told reporters.
Karachi's Mangopir area is said to be a hotbed of militants, who have fled the military operations launched by Pakistani army in the northern areas and tribal agencies.
"They were killed in a shootout as they opened heavy fire on the police when they raided a house in Gulshan-e-Buner," Anwar said.
He said the heavily-armed militants were asked to surrender but they retaliated with heavy firing to which the police responded.
Karachi is a city of 18 million people and contributes 42 per cent of the country's GDP. It has been plagued by sectarian, ethnic and political violence for years.