DHAKA, BANGLADESH — Two suspected members of a Bangladeshi Muslim militant group, including one who was out on bail on a charge of attempted murder, were arrested in the killing of a secular blogger in the fourth such deadly attack this year.

Saad-al-Nahin and Masud Rana were arrested Thursday evening by the detective branch, which has been handling the case rather than regular police, said Dhaka Metropolitan Police spokesman Muntasirul Islam. They are suspected members of Ansarullah Bangla Team, a group blamed for some of the previous attacks on bloggers.

Local media reported that Nahin was arrested in 2013 on a charge of attempted murder in an attack on blogger Asif Mohiuddin, who was injured. Nahin was freed on bail but was supposedly being watched by detectives.

Last Friday, at least four men posing as tenants entered an apartment building and hacked to death 28-year-old Niladri Chottopadhay Niloy. The blogger’s wife, Asha Moni, filed a murder case against four unnamed persons.

Friends of Niloy, who also goes by an online name of Niloy Chowdhury, said he had received several threats that prompted him to remove all his photos from his blog. They said he had a Facebook account in which he criticized radical Islamists at home and abroad, as well as hard-line views of other religions.

The family and friends said Niloy had sought police protection after he was threatened, but police asked him to leave the country for his safety.

Hours after the killing, Ansar-al-Islam, which intelligence officials believe is affiliated with al-Qaida on the Indian subcontinent, sent an email to media organizations claiming responsibility and calling the blogger an enemy of Allah. The authenticity of the email could not be independently confirmed.

The United States has expressed its concern over the killing, while the United Nations called for Bangladeshi authorities to ensure accountability and prevent such violence.

In February, Bangladeshi-American Avijit Roy was hacked to death on the Dhaka University campus while walking with his wife. Two others were attacked and killed in March and April, one in Dhaka and another in the northeastern city of Sylhet. Investigations into the previous cases made no headway.

Islam is Bangladesh’s state religion, but the Muslim-majority country is governed by secular laws based on British common law. Over the last decade or so, extreme interpretations of Islam have steadily gained ground.