(CNN) In his writings, author Avijit Roy yearned for reason and humanism guided by science.

He had no place for religious dogma, including from Islam, the main religion of his native Bangladesh.

Extremists resented him for openly and regularly criticizing religion in his blog . They threatened to kill him if he came home from the United States to visit.

Within minutes after the Thursday attack, Rahman posted photos of the crime scene, said Col. Ziaul Ahsan of Bangladesh's elite anti-crime unit, the Rapid Action Battalion.

Within minutes after the Thursday attack, Rahman posted photos of the crime scene, said Col. Ziaul Ahsan of Bangladesh's elite anti-crime unit, the Rapid Action Battalion.

In a Facebook comment last year, Rahman allegedly wrote, "Avijit Roy lives in America. So it's not possible to kill him now. But when he returns home, he will be killed then."

In a Facebook comment last year, Rahman allegedly wrote, "Avijit Roy lives in America. So it's not possible to kill him now. But when he returns home, he will be killed then."

The suspect, Farabi Shaifur Rahman, had called for Roy's death in numerous Facebook posts.

The suspect, Farabi Shaifur Rahman, had called for Roy's death in numerous Facebook posts.

Social media photos show the prime suspected arrested in the murder of American-Bangladeshi blogger Avijit Roy, who was hacked to death in Dhaka last week.

Social media photos show the prime suspected arrested in the murder of American-Bangladeshi blogger Avijit Roy, who was hacked to death in Dhaka last week.

On Thursday, someone did.

As usual, Roy defied the threats and departed his home in suburban Atlanta for Dhaka, where he appeared at a speaking engagement about his latest books -- one of them titled "The Virus of Faith." He has written seven books in all.

As he walked back from the book fair, assailants plunged machetes and knives into Roy and his wife, killing him and leaving her bloodied and missing a finger.

Afterward, an Islamist group "Ansar Bangla-7" reportedly tweeted, "Target Down here in Bangladesh."

Investigators are proceeding on the notion that Roy's murder was an extremist attack. His father, Ajay Roy, filed a case of murder with the Shahbagh police Friday without naming suspects.

No one came to their aid as they were hacked down, a witness said. "I shouted for help from the people but nobody came to save him."

But at night, secularist sympathizers marched through a street holding torches; by day, others held a sit-in to protest Roy's killing. The government condemned the attack.

Incredibly powerful photo by Munir Uz Zaman of secular activists in Bangladesh protesting the murder of #AvijitRoy. pic.twitter.com/ghP5GmbqzZ — Michael De Dora (@mdedora) February 27, 2015

Who was the software engineer, a U.S. citizen from Alpharetta, Georgia, who drew such rage from some and adoration from others?

Who was Avijit Roy?

Software was his career, but writing and blogging were his calling. And he did not speak alone. Roy founded the religion critical blog Mukto Mona, which served multiple writers.

He called it "an Internet congregation of freethinkers, rationalists, skeptics, atheists and humanists mainly of Bengali and South Asian descent who are scattered across the globe."

Its mission was to promote science, secular philosophy, democracy and religious tolerance in articles by academics and activists.

Its headers contain quotes by famous scientists, including one attributed to Albert Einstein condemning the doctrine of heaven and hell as a means of enforcing ethics:

"A man's ethical behavior should be based effectually on sympathy, education and social ties and needs; no religious basis is necessary."

To the most devout and to extremists, Roy's criticisms amounted to blasphemy. He took aim at the sentiment in a blog post headlined, "Happy Blasphemy Day, Happy Birthday 'Mukto Mona .'"

Some who felt oppressed by religion said he spoke for them.

"Avijit Roy, your voice of reason and your passion for free thinking will never die. You were a voice to so many voiceless," a fan wrote after his death.

Avijit Roy, your voice of reason and your passion for free thinking will never die. You were a voice to so many voiceless. Thank you. — Moston Rat (@therevkid) February 28, 2015

How stark was his criticism?

Very. Roy and the blog's other critics took off the gloves when it came to religion, particularly Islam.

Roy was a fan of Bill Maher's harsh reproach of Islam and a critic of Reza Aslan, who has countered Maher's standpoint.

Aslan feels irritated, and he should be. Cause, someone shows that his emperor has no clothes! http://t.co/cNzrGL8qML #AnApostatesExperience — Avijit Roy (@avijit_roy_MM) October 16, 2014

His blog called Aslan "an Islamic apologist, who obviously feels threatened by the growing Atheist movement in the U.S. and worldwide."

Roy likened women in burkas to "living zombies," tweeting out a cartoon of one standing next to a child dressed as a ghost for Halloween.

Did he blame religion for violence?

Yes. He began one of his final articles by writing that January's Charlie Hebdo massacre in France was "a tragic atrocity committed by soldiers of the so-called religion of peace."

He doled out scathing criticism after another Bangladeshi blogger was hacked to death outside his home in 2013 by assailants with machetes.

"The virus of faith was the weapon that made these atrocities possible," Roy wrote.

But he also criticized Christianity. "So, Pope Francis thinks 'evolution is real'! And it is still a major headline news in this century," he recently tweeted.

To Roy, God was an outdated notion.

JUST WATCHED U.S. Blogger Hacked To Death In Bangladesh Replay More Videos ... MUST WATCH U.S. Blogger Hacked To Death In Bangladesh 06:00

Did he only criticize religion?

Roy sought enlightenment in doubt, criticism and reason. Question everything, was a theme in his online posts. Never think you've found the truth.

He was a science geek who admired Charles Darwin, evolutionary psychology and astrophysics, according to a Facebook account in his name. CNN could not independently verify it belongs to him.

Roy was a fan of "Cosmos," the TV series explaining the science behind the origin of the universe, and of the geek sitcom "The Big Bang Theory."

Mukto Mona contains sections titled "Science" and "Rationalism," but most of the articles hold science up to religion as a litmus test, which it invariably fails.

"To me, it is a rational concept to oppose any unscientific and irrational belief," Roy said.

Could he have known he would be killed?

That's likely. He regularly attended a February book fair in the Bangladeshi capital, and last year, after he launched "The Virus of Faith," the death threats began streaming in.

They landed in his email inbox and cropped up on social media.

"A well-known extremist ... openly issued death threats to me through his numerous Facebook statuses," Roy wrote.

His book "hit the cranial nerve of Islamic fundamentalists," Roy wrote. After the Charlie Hebdo attacks, an online Bangladeshi bookstore pulled it after extremists put pressure on it.

But is seemed the author was safe in Alpharetta.

"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," the Islamist wrote, according to Roy.

He couldn't let that stop him, Roy's friend Michael De Dora said.

"Avijit was very idealistic," he said. "His understanding was that he wouldn't be killed, that if anyone ever tried to attack him or hated him, that they could just kind of have a chat and he would convince them ... that they could at least have a dialogue."

He never had a chance to. They attacked from behind.