President Emomali Rakhmon signed the measure into law after it was unanimously adopted by the upper house of parliament last month, local news reports said.
The law bans those under the age of 18 from praying in churches or mosques and requires them to study in secular schools, Aziya-Plus news agency said.
The authorities said the change would help stem the spread of religious fundamentalism in the overwhelmingly Muslim but secular nation. But the bill’s passage was strongly condemned by religious groups.
“The ban to attend mosques will give rise to the negative reaction among the people,” prominent Muslim theologian and former deputy Prime Minister Akbar Turadzhonzoda said in an open letter to the president.
Other religious leaders noted that Rakhmon signed the law in the beginning of the holy month of Ramadan - a period of fasting and prayer for Muslims.