There were at least five assailants, who fled after the attack Thursday evening in Haripur village, Bogra district police chief Mohammed Asaduzzaman said.
No one claimed responsibility for the attack, which killed a mosque official in his 70s who had been leading the prayers. Three others were being treated at a hospital for bullet wounds.
The attack follows a wave of deadly assaults this year on foreigners, secular writers and members of the Shiite community in the Sunni-majority nation of 160 million.
The attacks, claimed by radical Islamist groups, have alarmed the international community and raised concerns that religious extremism is growing in the traditionally moderate South Asian nation.
Police have arrested six members of the banned local group, Jumatul Mujahedeen Bangladesh, in connection with the Oct. 24 bombing attack on an annual rally of thousands of Shiite Muslims in Dhaka, according to senior Detective Branch official Munirul Islam. The bombs, lobbed into the crowd as they were gathering for an early morning procession through the capital, killed a teenage boy dead and left more than 100 people injured.
Authorities had quickly dismissed a claim of responsibility by the Islamic State group, saying they had no presence in the country, and that the culprits were likely from Jumatul Mujahedeen Bangladesh.
Islam said security officials had killed the alleged mastermind of the Oct. 24 attack, Al Bani, during a gunfight Thursday morning in a Dhaka suburb. Islam described Bani as the "military commander" of the banned group, and said he and his accomplices had opened fire on security forces as they were preparing to conduct a raid.
The Islamic State group has also claimed responsibility for the killings of two foreigners — an Italian aid worker and a Japanese agricultural worker — but again the government said IS has no organizational presence in the country.
The government of Prime Minister Sheikh Hasina accuses domestic Islamist groups along with the main opposition Bangladesh Nationalist Party and its main Islamist ally, the Jamaat-e-Islami party, of carrying out the attacks to destabilize the country for political gain.