DHAKA, Bangladesh — More than 3,000 people, some of them known Islamist militants, have been arrested in a series of police raids intended to quell a wave of deadly machete attacks against bloggers, minorities and others, the police said Saturday.

The roundup began last week after militants killed the wife of a police superintendent who had been investigating the machete attacks. Over the course of the week, the police said, they killed five militants in shootouts. They were members of the Jama’atul Mujahedeen Bangladesh, one of two groups that the authorities believe are behind most of the attacks, the police said.

Many citizens criticized the government for not taking action sooner against the militants, who have created a climate of terror since they began murdering secularist bloggers and others more than three years ago.

Since 2013, bloggers, freethinkers, religious minorities, foreigners, gay activists, followers of more liberal strains of Islam and others have been killed in attacks carried out mostly by groups of young men wielding machetes.