Raihan Abir glances at the book in his hands, his eyes focused on the religious symbols that dot its reddish brown cover. When Philosophy of Disbelief was published in 2011, it shocked many in Bangladesh – not so much for its promotion of atheism but for its quick climb to the top of the country’s bestseller lists.

Many of those killed had publicly expressed opinions on religion, science, sexuality or music. Both Isis and Ansar al-Islam, a militant group linked to al-Qaida, have claimed responsibility for the killings.

The common thread linking the lives of many of the victims is Mukto-mona, meaning Free Thinker, a Bengali-English website dedicated to the discussion of topics that range from atheism to science. Abir became involved with the site in 2007, drawn to what he describes as a window on to a world long hidden in conservative Bangladesh.

“I was living in a bubble with lots of propaganda fed to me by society,” he says. “It was really easy to reach the age of 22 in Bangladesh and never hear about the science of evolution rather than intelligent design propaganda.”

When he and Roy released Philosophy of Disbelief, the book became an instant hit, feeding into the fledgling conversation ignited by websites such as Mukto-mona.

But it also caught the attention of Islamist extremists who were determined to make Bangladesh reflect their own conservative beliefs . Abir points to the 2013 murder of secularist blogger Ahmed Rajib Haider, hacked to death in front of his home, as the first of what would become a terrifying pattern of murders in the country.

Two years later – as Abir was becoming accustomed to regularly receiving death threats by email and text – the number of attacks began to spike. “It got out of control,” he says.

The death of his co-author left him racked with grief. Apprehension set in months later, after another blogger, Washiqur Rahman, was hacked to death outside his home.

“I knew it was my turn,” Abir says with a wry smile. The idea began to permeate every moment of his life. Each morning his wife, Samia Hossain, would emerge first from their home to check for attackers. “Once she said it was clear, we would hit the road on our motorbike,” he says. Hossain kept constant watch behind them as he drove.

Despite the sweltering heat, he would keep his motorbike helmet on as walked through the university campus where he was completing his PhD in biomedical engineering. “My physician friends said you have to keep your helmet on to keep your head intact.”

When his PhD supervisor decided to attend a medical conference in Toronto, he urged Abir to join him and seek refuge in Canada. Abir hesitated, torn by the idea of leaving behind his research on the use of telemedicine in rural areas and still tied to the challenge of carving out a school of secular thought in the increasingly polarised country.

The final push came with the death of Ananta Bijoy Das, an editor of Philosophy of Disbelief. The two had been in constant contact as Das – worried about the death threats he was receiving – attempted to secure a visa to Sweden. Soon after his application was rejected by Swedish authorities, he was attacked by several masked men wielding machetes in broad daylight.

In June of last year Abir travelled to Toronto, leaving behind Hossain who was six months pregnant at the time. Neither had any idea when they would see each other again. “I knew that I might not be able to see her for three or four years,” he says.

Still, she was ecstatic to see him go. “When the plane left and was in the air, I knew he would be alive. I was so happy,” says Hossain. An architect by training, she followed in her husband’s footsteps, applying for a visa to attend a conference in her field in Toronto. Two months later, a very pregnant Hossain was on a plane to Toronto.

“I thought it would be the happiest day of my life,” says Abir. But while Hossain was in the air, news came of another death among their tight-knit circle of friends. Atheist blogger Niloy Neel had been hacked to death in his home. “It was a really stressful time,” he says. “We were losing the brightest minds of Bangladesh one by one.”

Things soon began to fall into place for the young couple. Days after they found a place to call home in Toronto, their daughter Sophie was born. Their application for refugee status was accepted a few months later.

Slowly the pair allowed themselves to shake off the fear that had coloured their lives in Dhaka. “In Bangladesh I literally would take one step and look behind my back. I wasn’t supposed to be alive,” says Abir as he sits at a table in the couple’s sparsely decorated apartment. His wife nods sombrely in agreement as she sits next to him. “Yeah, he wasn’t.”

Toronto’s sizable Bangladeshi community, however, has meant the couple hasn’t been able to let their guard down entirely. Last year Abir’s name and the fact that he was now living in Canada were included on a global hit list published by an Islamist group. The group vowed to “hunt them down in whatever part of God’s world we find them in and kill them right there”.

After a bungled response that included recommending that bloggers self-censor themselves and avoid offending religious sentiments, recent months have seen Bangladeshi authorities vow to crackdown on the violence. So far, according to Human Rights Watch, this has largely translated into the detention of some 15,000 suspects with scant evidence.

Thousands of miles away from Dhaka and its climate of fear, Abir’s hope for the country continues to run deep. “Now, yes we are being attacked, our atheist writers, our bloggers are refugees in the world. But things will change, Bangladesh is not like that.” He continues to work with Mukto-mona, his passion for its ideas now accompanied by a deep sense of responsibility as one of the few who made it out alive.

His focus is now on the dozens of Bangladeshi writers still under threat in the country, many of them in hiding and fearing for their lives. “We’re trying to make connections with the outer world and get them to safe places. We don’t have any resources, we’re just trying to do what we can,” he says. “But it is really difficult to fight off machetes with a pen.”