Security officials said several people were detained in raids in districts affected by the fighting linked to the ethnic and religious tensions that have long plagued Karachi, home to the country’s main port, stock exchange and central bank.

An official from the paramilitary Rangers said troops had set up checkpoints and increased spot checks in tense areas.

“We have deployed troops in most of the troubled areas, and will take strong action if we see any trouble,” he said. “We also conducted an operation last night, where we cordoned off some of the troubled areas and detained some suspects.”

Most districts were calm on Wednesday, though there were reports of three bodies found in different areas. Officials say more than 300 people were killed in Karachi in July alone — one of the deadliest months in almost 20 years.

Some officials say about 200 killings may have been targeted — linked to victims’ ethnic or religious affiliations. Officials pledged further action to curb violence.

“We will carry out specific and targeted operations in the troubled areas, based on intelligence reports,” said Sharfuddin Memon, an adviser at the provincial home minister. “We are hopeful these actions will help restore peace in the city.”

Memon put the death toll this week at least 35.

Trouble has persisted despite the deployment of hundreds of new troops to tackle last month upsurge in violence in western Orangi town district. About 100 people died in three days. Rangers took control of the area, but violence has since spread to other parts of the city of more than 18 million, prompting severe criticism of authorities.

Altaf Hussain, the leader of the Muttahida Qaumi Movement (MQM), which dominates Karachi, accused the government from his base in London of failing to take action to restore peace.

“There has been no action yet against those involved in violence,” Hussain, who has lived in self-imposed exile since 1992, said.

“Given the attitude of the government and the law enforcement agencies, I request the public to buy rations for at least a month, even if they have to sell something valuable for that.”

Ethnic, religious and sectarian disputes and political rows can often explode into battles engulfing entire city districts. Al Qaeda-linked militants targeted Karachi for bombings, kidnappings and assassinations after the Sept. 11, 2001 attacks on the United States, when Pakistan joined the US-led campaign against militancy. Foreigners were repeatedly attacked.

Street thugs and ethnic gangs have been used by political parties as foot soldiers in a turf war in a city which contributes about two-third of Pakistan’s tax revenue.

Though many investors are used to violence in Karachi and other regions, extended lawlessness can only add to concerns.

Sentiment at the stock market was hurt by the trouble, and the main index ended 2.33 percent lower on Wednesday.

“The worsening law and order situation is one of the reasons for the low volumes in the market in recent days,” said Khalid Iqbal Siddiqui, a director at brokers Invest and Finance Securities Ltd.

“Everyone seems to be worried about the situation in Karachi and no one is ready to take fresh positions in this situation.”