DHAKA, Bangladesh — A group of men on Friday slit the throat of Niladri Chaterjee, an activist whose social media posts were often critical of Islam, in the fourth fatal attack this year against secular bloggers, the police said.

The assailants initially posed as potential renters asking to see the property where Mr. Chaterjee lived, said Deputy Police Commissioner Mohammad Anwar Hossain, who visited the crime scene. When they were refused entry, they forced their way in, confined Mr. Chaterjee in a room and slashed his head and neck, Commissioner Hossain said.

Mr. Chaterjee’s killing followed a pattern that has become familiar in Bangladesh.

Islamists here have long clashed with other young people who advocate a secular Bangladesh, and in recent years they have begun to assassinate people who criticize Islam online.

Mr. Chaterjee had monitored those attacks, some of which were aimed at his friends, and feared he would be next.