Criminal cases against the two madarsa students -- Zikrullah and Ariful -- and two others were filed by the Bangladeshi police for the murder of Washiqur Rahman, the second such attack in recent weeks.
Dhaka's Metropolitan Magistrate Younus Khan granted the police eight days custody of the two who were arrested near the crime scene.
Police had sought a 10-day remand under the case filed against four Islamists, who are students of a madarsa in the southeastern port city of Chittagong.
They allegedly killed Rahman for his blasphemous remarks on Facebook.
More From This Section
"It was our religious duty to kill him (Rahman)...This will ensure our place in the heaven," Zikrullah told court.
A police officer earlier told reporters that during the initial investigation, the two detained assailants said they murdered Rahman on the directions of a man called Masum and another man named Abu Taher was a member of their "three-men killing mission".
Zikrullah told court that Taher was the one who carried out the hacking.
The official said the suspects under arrest claimed that they were not known to each other before a recent meeting called by Masum to discuss the murder plan.
Initial reports identified Rahman as a NGO worker but relatives later said he was a travel agency executive and used to write for a blog.
The murder came a month after Bangladeshi-American Avijit Roy, a secular blogger and science writer, was hacked to death in an identical manner in Dhaka.
Zikrullah and Ariful were students of a madrasah which is dominated by an Islamist group called Hefazat-e-Islam which waged a massive campaign in 2013 against secular bloggers and tried to lay a siege around Dhaka for indefinite period.