KARACHI: Counting was under way in a by-election in Pakistan's commercial hub Karachi Sunday, after shooting attacks killed at least 22 people in the city, where ethnic and political violence has raised fears of instability. Pre-election bloodshed Saturday night killed at least 22 people, police said. In August, a lawmaker of Karachi's dominant Muttahida Qaumi Movement (MQM) was killed by gunmen, sparking violence which killed 100 people in a week. MQM's rival, the ethnic Pashtun-based Awami National Party (ANP), boycotted the by-election after complaining that the MQM would rig the poll. Aside from trying to contain violence in Karachi, the government faces a Taliban insurgency and the task of rebuilding areas devastated by summer floods which inflicted $9.7 billion in damage and will strain the weak economy for several years. The MQM accused the ANP of carrying out the killings, an allegation it denied. “Soon after announcing its boycott of the by-election, ANP's terrorists began killing innocent citizens in a bid to sabotage the election process,” the party said in a statement. The party said 25 people, including MQM workers, were killed. Karachi often shuts down for brief periods after political killings, as well major bombings police usually blame on militant groups. Stock market investors keep a wary eye on tension in Karachi, home to Pakistan's main port, stock exchange and central bank and the main gateway for Western military supplies bound for neighboring land-locked Afghanistan. The city has a long history of ethnic, religious and sectarian violence. But hundreds of targeted killings this year have raised concerns that violence would escalate and create a new crisis for the US-backed federal government. The city was a main target of Al-Qaeda-linked militants after the Sept. 11, 2001, attacks on the United States, when Pakistan joined the US-led campaign against militancy, and foreigners were attacked in the city several times. Provincial Health Minister Mohammad Saghir said gunmen attacked people belonging to ethnic and political groups to “ruin the peace of this city”. About 40 people were wounded, he said. The MQM's leadership was weighing all options in response to the violence, including withdrawing from the provincial coalition government led by the Pakistan People's Party (PPP) of President Asif Ali Zardari, a source said.