KARACHI, Pakistan (AP) — Pakistani police raided two militant hideouts on the outskirts of the port city of Karachi, sparking shootouts in which 12 militants were killed, a senior police officer said Wednesday.

Seven of the slain men belonged to Pakistan's anti-Shiite Lashkar-e-Jhangvi militant group while five were from al-Qaida's branch in the Indian subcontinent, said the officer, Rao Anwar.

The shootouts occurred over the past 48 hours, Anwar told reporters, adding that the slain suspects were involved in killings of civilians and attacks on security forces. He said two policemen were also wounded in the shootouts and that officers recovered bomb-making material, guns and assault rifles from the militants' hideouts.

Karachi is the capital of southern Sindh province, which has witnessed multiple militant attacks in recent years.

Earlier Wednesday, the Pakistani military said army chief Gen. Raheel Sharif ordered troops to launch the final phase an operation to purge militants in a tribal region near the Afghan border.

In a statement, the military said Sharif issued the instruction during a visit to North Waziristan, where the army launched a massive operation to eliminate local and foreign militants in June 2014. The military claims it has cleared 90 percent of the region, which once served as the base of the Pakistani Taliban.