When Joseph and Mary brought their baby Jesus to the Temple in order to perform the rituals that God had commanded in his laws, the Spirit led Simeon to enter the Temple courtyard, and revealed to him that Jesus was the Messiah.