Until he was stabbed multiple times with a kitchen knife and forced to flee to Europe two years ago, Asif Mohiuddin was a leading member of Bangladesh’s ‘‘freethinker’’ movement and the country’s best-known secular provocateur. We met last June at a cafe on a pedestrian promenade around the corner from his apartment, a sunlit space in a shabby-­chic neighborhood in northern Germany. (He asked me not to name the city.) Mohiuddin, dressed that day in jeans and a green T-shirt that proclaimed ‘‘American Atheists Convention, Memphis, April 2-5, 2015,’’ was still getting used to the tranquillity of his new surroundings. Shortly after he secured a fellowship at a German institute and left Bangladesh, extremists serially murdered four of his friends — all secular bloggers who had criticized fundamentalist Islam and whose names appeared on ‘‘hit lists’’ assembled by hard-­liners and disseminated on social media. ‘‘Everybody is wondering who will be next,’’ Mohiuddin told me while picking halfheartedly at the kiwi slices on his plate.

Mohiuddin, who is 31, grew up in a Muslim family in Dhaka, Bangladesh’s capital city of 14 million. The son of a middle-­ranking civil servant, he studied religion after school at a mosque. ‘‘I learned many ridiculous things — that I would get virgins in heaven, or that I would suffer the ultimate punishment in hell for eternity,’’ he said. At 13, he declared himself an atheist. Muslims make up 89 percent of Bangladesh’s population (Hindus, Buddhists and Christians constitute most of the rest), and belief in God is near universal; for a child to profess such lack of faith was unheard-­of, and his father was deeply shamed. While in high school, Mohiuddin read ‘‘A Brief History of Time,’’ by Stephen Hawking, which he calls ‘‘a major influence.’’ At 16, he picked up a Bengali science magazine that used relativity theory and other scientific principles to explain miracles described in the Quran. He felt compelled to challenge the article in print. ‘‘I wrote that it was scientifically impossible for the Prophet Muhammad to ascend to heaven on a horse,’’ he said. The science magazine barred him from its pages, but he began contributing to the religion section of Dhaka newspapers, sharing the space with believers. ‘‘The Islamists would write during Ramadan that fasting is very good for health, that it creates new brain cells, and I would write back, ‘This is [expletive],’ ’’ he told me.

In 2008, after earning a degree in computer science, Mohiuddin turned to blogging. Writing in Bengali for a website called Somewhere in ... Blog, he drew upon the thinking of Bangladeshi philosophers and agnostics like Humayun Azad, whose most ­famous work, ‘‘Nari,’’ criticized the chauvinistic attitude of Islam toward women and was banned by the Bangladeshi government in 1995. (The ban was lifted five years later.) Mohiuddin’s online writing grew even more strident. His posts — advocating women’s rights and secular education, criticizing a law banning marriages between Hindus and Muslims, condemning communal violence targeting Hindus and questioning the infallibility of the prophet — attracted as many as one million views. They also enraged the country’s ­Islamists, a relatively small but increasingly vocal part of the country’s population of 168 million. Mohiuddin was sometimes challenged by the Islamists to debates in Dhaka, packed public forums during which he would only anger them further. ‘‘They said, ‘You should say the prayer to Muhammad before we start,’ ’’ he said. ‘‘And I said, ‘Why should I?’ ’’ Gradually, the invitations stopped, and the threats began.