Authorities in Bangladesh arrested a suspect Monday in the slaying of secular American blogger Avijit Roy.

An elite police unit announced it had detained Farabi Shafiur Rahman, who had threatened in Facebook posts to kill Roy, a prominent Bangladeshi American writer who was a vocal critic of militant Islam.

Farabi “confessed to his statements to kill Avijit, which he had made several times,” a spokesman for the Rapid Action Battalion, Cmdr. Mufti Mahmud Khan, told a news conference.

Police said Farabi did not admit to involvement in Roy’s killing.

Roy, a 42-year-old resident of the Atlanta area who was visiting Dhaka for a book fair, was killed and his wife was severely wounded in a machete attack Thursday on the Dhaka University campus.

Bangladesh slaying

Munir uz Zaman / AFP/Getty Images

Mourners in Dhaka, Bangladesh, pay their respects Sunday to Avijit Roy, a Bangladeshi American blogger who was hacked to death in the capital last week.

Mourners in Dhaka, Bangladesh, pay their respects Sunday to Avijit Roy, a Bangladeshi American blogger who was hacked to death in the capital last week. (Munir uz Zaman / AFP/Getty Images)

Roy, a software engineer, founded a website called Mukto-mona, which means “free mind.” His outspoken liberalism and criticism of organized religion, primarily conservative Islam, had made him a target of Islamist groups in Bangladesh, which have targeted secular writers in the past.

Police said Roy and Farabi had interacted on Facebook about five years ago, and Roy blocked him from his page after the two had an argument.

In a Facebook post in January 2014, Farabi said it was “a holy duty” of Muslims to kill Roy. Weeks later, he posted: “Avijit Roy lives in America and so, it is not possible to kill him right now. But he will be murdered when he comes back.”

Farabi was arrested in 2013 after posting comments on social media in support of the killing of another secular blogger, Ahmed Rajib Haidar. He was later released on bail.

Special correspondent Kader reported from Dhaka and Times staff writer Bengali from Mumbai, India.