According to tradition, Joachim wanted to pray in the temple but was turned away because of his childlessness. He went to a mountaintop to pray to God. An angel appeared to him and his wife, Anna. The angel told Joachim that the Lord heard their prayers and that Anna was with child. 