Police said the mosque inside the Isha Khan naval base in the south eastern city was packed with Muslim worshippers attending Friday prayers when several bombs were thrown.
"Of the five bombs thrown at the mosque, two exploded. They looked like small grenades. Six people were injured," Deputy Commissioner of the Chittagong Metropolitan Police (CMP) Harun Ur Rashid Hazari told AFP.
Bangladesh arrests three members of banned extremist group
Two people were arrested at the scene but no group has yet claimed responsibility for the attack, he said.
Chittagong police chief Abdul Jalil Mandal confirmed the attack, saying the bombs were thrown towards the end of the weekly prayers.
The country's armed forces in a statement said two Molotov cocktails were detonated at the mosque.
The military added the wounded suffered minor injuries and were given first aid.
Arrest in Bangladesh over death threats to secular writers
"One person was arrested with unexploded explosives," the military said, adding a probe had been launched.
Bangladesh has been roiled by rising unrest which has seen four atheist bloggers and a publisher hacked to death this year.
Two foreigners have also been shot dead -- a Japanese farmer and an Italian aid worker -- while several minority Sufi Muslim leaders and two policemen have been killed.
Cost of loyalty: JI chief rails against rulers for silence over executions
Police blame an outlawed extremist militant group, Jamayetul Mujahideen Bangladesh, for the recent violence while Prime Minister Sheikh Hasina's government accuses the main opposition party and its ally of trying to trigger anarchy.
The parties deny the claims.
Analysts say extremist militants pose a growing danger in conservative Bangladesh and that a long-running political crisis has radicalised opponents of the government.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ