The feast is associated with an event recounted not in the New Testament, but in the apocryphal Protoevangelium of James. According to that text, Mary's parents, Joachim and Anne, who had been childless, received a heavenly message that they would have a child. In thanksgiving for the gift of their daughter, they brought her, when still a child, to the Temple in Jerusalem to consecrate her to God. Later versions of the story (such as the Gospel of Pseudo-Matthew and the Gospel of the Nativity of Mary) indicate that Mary was taken to the Temple at around the age of three in fulfillment of a vow. Tradition held that she was to remain there to be educated in preparation for her role as Mother of God.