Protoevangelium of James 7
Gospel of James7 Time passed, and the child grew. When she was two years old, Joachim said, “Let’s take her to the temple of the Lord to fulfill the vow we made, in case the Lord calls us before we’ve made our offering.” But Anna replied, “Let’s wait until she’s three, so she won’t miss her father or mother.” Joachim agreed, and they waited. When the child turned three, Joachim said, “Invite the undefiled daughters of the Hebrews, and let each one take a lamp. Let them stand with the lamps burning so the child won’t turn back or become distracted from going to the temple of the Lord.” They did this as they made their way to the temple. The priest welcomed her, kissed her, and blessed her, saying, “The Lord has exalted your name for all generations. In you, in the last days, the Lord will reveal His redemption to the people of Israel.” He then set her down on the third step of the altar, and the Lord God poured grace upon her. She danced with joy, and all the people of Israel loved her.
Mishnah Niddah 5.4
MishnahA girl who is three years and one day old, whose father arranged her betrothal, is betrothed through intercourse, as the halakhic status of intercourse with her is that of intercourse in all halakhic senses. And in a case where the childless husband of a girl three years and one day old dies, if his brother the yavam engages in intercourse with her, he acquires her as his wife; and if she is married, a man other than her husband is liable for engaging in intercourse with her due to violation of the prohibition against intercourse with a married woman. And if she is impure due to menstruation, she imparts impurity to one who engages in intercourse with her who then renders impure all the layers of bedding beneath him, rendering them impure like the upper bedding covering a zav, in the sense that it assumes first-degree ritual impurity and does not become a primary source of ritual impurity, and it renders impure food and drink, but it does not render impure people and vessels. If she marries a priest, she may partake of teruma, like any other wife of a priest; if she is unmarried and one of the men who are unfit for the priesthood, e.g., a mamzer or ḥalal, engaged in intercourse with her, he disqualifies her from marrying into the priesthood, and if she is the daughter of a priest, she is disqualified from partaking of teruma. Finally, if one of all those with whom relations are forbidden, as stated in the Torah, e.g., her father or her husband’s father, engaged in intercourse with her, they are executed by the court for engaging in intercourse with her, and she is exempt, because she is a minor. If the girl is less than that age, younger than three years and one day, the status of intercourse with her is not that of intercourse in all halakhic senses; rather, it is like placing a finger into the eye. Just as in that case, the eye constricts, sheds tears, and then returns to its original state, so too, in a girl younger than three years and one day old, the hymen returns to its original state.
Notes and References
"... One of the underlying assumptions of the Mishnah is that if a child loses her virginity before the age of three, her hymen will spontaneously regenerate. Mishnah Niddah 5.4 says that, “if she is younger than this [three years and a day], it is as if one puts a finger in the eye” (i.e., it will cause temporary discomfort, but will not have any permanent physical effect). This belief in the regeneration of the hymen is important when considering the suitability of a given child ... The implications of this teaching are clear and consistent through-out the Mishnah. When we read the Protoevangelium of James through the lens of the Mishnah, it takes on a significant meaning. The Protoevangelium’s exacting language about age focuses attention on Mary’s purity and her betrothal. After a girl turns three and a day, she becomes a Ketannah and in a purely physical sense, she is more vulnerable to de defilement. Now she must be protected lest she lose her status as a virgin ... The fact that Protoevangelium of James stresses the age of Mary in this way makes it clear that she was three ..."
Horner, Timothy J Jewish Aspects of the Protoevangelium of James (pp. 313-335) Journal of Early Christian Studies, Vol. 12, No. 3, 2004