Police said Abdul Hakim, 22, and Mahmudul Hasan, 17, had been members of banned local Islamist outfit Jamaayetul Mujahideen Bangladesh (JMB), blamed for a cafe siege that left 20 mostly foreign hostages dead.
Elite Rapid Action Battalion spokesman Mufti Mahmud Khan said the pair had recently reached out to police for assistance as part of a new scheme announced by the national police chief.
"They were involved with the organisational activities of JMB. They issued a plea to us through their parents to return to a normal life, therefore, we facilitated their return," Khan told AFP.
A string of attacks by Islamist groups targeting religious minorities, secular and liberal activists as well as foreigners have blighted Bangladesh over the last three years.
Also Read
The government was left reeling after Islamist militants hacked to death and shot the hostages in the siege on an upmarket Dhaka cafe in July.
The Islamic State organisation claimed responsibility but Prime Minister Sheikh Hasina's secular government blamed the JMB.
Little is known about the two recruits, but Hakim told the ceremony he had chosen "a dark path when there was no aim in life and he had no wish to live".
Three siblings belonging to another banned outfit, Hizb-ut-Tahrir, also surrendered to police on Monday, authorities have said.
Security analyst Shahab Enam Khan applauded the scheme which comes after the government's hardline crackdown on opposition activists that has seen thousands arrested and raised allegations of human rights abuses.
"It is good that the government is pursuing a liberal policy rather than only focusing on hard approaches," Khan, who teaches at Bangladesh's Jahangirnagar University, told AFP.
Disclaimer: No Business Standard Journalist was involved in creation of this content