They said hundreds of workers attacked factories at Ashulia, on the capital's outskirts, hit vehicles with sticks and stones, and fought battles with police trying to disperse them.
Some highways were blocked by the workers, officials added.
The violence started on Saturday as workers at Suhi Industrial Park protested against alleged non-payment of salaries, and continued sporadically until Sunday afternoon, fuelled by the deaths, which the workers said were due to firing by police.
'We stepped in and took necessary actions to end the violence and clear the highways,' a senior police officer who declined to be identified told Reuters by telephone from the scene.
The situation was now under control, he said, without giving details or commenting directly on the shooting allegations.
'We will sit with the labour leaders later on Sunday to look into the fueds and try to prevent any recurrence of such unfortunate incidents,' said Salam Murshedy, president of the Bangladesh Garment Manufacturers and Exporters Association.
Ready-made garments are the country's main export and earned nearly $11 billion or 76 percent of annual export income in the fiscal year ended in June 2008, officials said.
The garment sector employs more than 2.5 million workers, mostly women. It has faced similar violence many times in recent years over unpaid wages and overtime bills for the low-paid workers.