The attackers entered the mosque in Shibganj, some 200 miles (125 kilometres) north of Dhaka, during early evening prayers on Thursday and opened fire on the gathered worshippers before fleeing.
Television footage showed the heavily guarded Shia mosque with broken windows and blood stains on the floor.
Arrest in Bangladesh over death threats to secular writers
Police said the muezzin had been killed and three worshippers wounded in the shooting, a rare attack on minority Shia Muslims in the mainly Sunni nation.
The SITE Intelligence Group, which monitors extremist activity, said on its website that the Islamic State (IS) group had claimed responsibility in a message posted on Twitter.
Bangladesh authorities have previously said there is no evidence that IS militants are active in the country. However, the group has claimed a series of attacks in Bangladesh, including the shooting and wounding of an Italian priest and the killing of a Sufi Muslim shrine chief, both this month.
Security had been stepped up across the country after two top opposition leaders were hanged on Sunday following their conviction for war crimes committed during the 1971 independence conflict against Pakistan.
Facebook, WhatsApp, Viber blocked ‘indefinitely’ in Bangladesh
"We have picked up two Sunni locals for interrogation in connection to the shootout," Shibganj police chief Ahsan Habib told AFP early on Friday of the mosque attack, adding no arrests had yet been made.
The attackers struck a day after police shot dead a top extremist accused of hurling grenades at the country's main Shia shrine in the capital Dhaka last month, killing two people.
The bombing was believed to be the first attack on Shias in Bangladesh, though banned extremist groups have killed more than a dozen Sufi Muslims and attacked Hindus and Christians in the last two years.
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