Rav Yehudah has told us in the name of Rav: the name of that man is to be blessed, and his name is Yehoshua ben Gamla, for but for him the Torah would have been forgotten from Israel. For at first if a child had a parent, the parent taught him, and if they had no parent, they did not learn at all. What [verse] guided them? "And you shall teach them to your children" (Deuteronomy 11
), laying the emphasis on the word "you".
They then made an ordinance that teachers of children should be appointed in Jerusalem. What verse guided them? "For from Zion shall the Torah go forth" (Isaiah 2
Even so, however, if a child had a parent, the parent would take them up to Jerusalem and have them taught there, and if not, they would not go up to learn there.
They therefore ordained that teachers should be appointed in each area, and that children should enter school at the age of sixteen or seventeen. But if the teachers punished them, they would simply rebel and leave.
Then came Yehoshua ben Gamla and decreed that teachers of young children should be appointed in each county, and each town. and that children should enter school at the age of six or seven.
[translation by Soncino, edited for accessibility and gender neutrality]