Pakistan announced on Saturday its troops had taken back areas of Karachi occupied by armed groups and arrested more than 100 people after political violence across the vast port city claimed 95 lives.

Four days of unrest has been blamed on political and ethnic tensions, with gunmen firing on two buses in the early hours of Friday, killing 12 people including a six-year-old girl, according to security officials.

"Our paramilitary soldiers have secured the troubled localities and hills where armed terrorists were firing on innocent people, and have restored normal life," interior minister Rehman Malik told reporters.

"We'll treat anyone who disrupts Pakistan's financial capital as a supporter of Taliban and an enemy operating against our war on terror," he said.

Home ministry spokesman Sharafuddin Memon told AFP a 12-year-old boy hit by a stray bullet in Baldia neighbourhood early Saturday was also among the dead.

"More than 100 suspects, many of them with weapons, have been arrested," Memon said, putting the death toll at 95.

Authorities said they had asked residents evacuated as the violence broke out to return home but few had responded.

"I had left my house in Qasba on Tuesday for my workplace, but could only return home now when peace has returned after four days," Abdullah Khan, 33, said.

"I am a construction labourer and support my elderly parents, wife and six children. I am happy to see my family safe but we don't know when the situation will turn difficult again."

Police and hospital officials confirmed the toll and arrests.

"We have taken control of all the affected areas," said Farooq Bilal, a spokesman for the paramilitary Rangers.

A grenade attack in southern Bhimpura neighbourhood killed two men and injured three on Saturday.

"Unknown motorcyclists threw a grenade on some shopkeepers who were trying to open their shops in Bhimpura, killing two and injuring three others," police official Mohammad Rafiq said.

Gunfire could be heard in western neighbourhoods and hospitals were still receiving casualties, witnesses said.

The violence has been blamed on loyalists of the Muttahida Qaumi Movement (MQM), the dominant local party that represents migrants from India, and the Awami National Party (ANP) of Pashtuns from the northwest.

The latest bout of killings comes days after the MQM walked out of the federal government led by the Pakistan People's Party (PPP), a move which some analysts said made it harder for the government to intervene.

The worst affected areas are impoverished, heavily populated neighbourhoods in western Karachi, dotted with construction sites where armed men of different ethnicities have exchanged gunfire.