About 50 people fell ill in Bangladesh after inhaling gas that leaked from a fertilizer factory in the port town of Chittagong, an official said on Tuesday.

Police and the fire brigade were trying to contain the spread of ammonia that began on Monday night, said Mesbah Uddin, the district's deputy commissioner.

The state-owned factory producing diammonium phosphate fertilizer is on the bank of the Karnaphuli river, across the water from Chittagong, but wind has pushed the gas towards the city.

The gas had leaked from a pipeline, Uddin said. Residents in the affected area have been told to stay indoors.

Safety standards in Bangladesh have come under an international spotlight in recent years after a series of fires in garment factories, and the collapse of a garment factory complex, in which many hundreds of workers have been killed.