The setting for the events we read about in Luke 2:22-35 was the temple in Jerusalem. These things took place at least forty days after the birth of Jesus. That Joseph and Mary followed the prescribed laws related to the birth of their child demonstrated their loyalty to God while the sacrifices they offered at that time indicated their low economic status (Exo 13:1-2, 11-16; Lev 12:1-8).
In God’s providence, at the time Joseph and Mary presented Jesus in the temple as their first-born son, there was a devout man there named Simeon. The Holy Spirit had revealed to him, evidently, he was an elderly man, that he would not die before he saw the Messiah. When he saw Jesus, he took Him up in his arms and stated that he could now depart in peace. God revealed to Simeon that Jesus was and is the Messiah.
Simeon went on to reveal that the people of Israel would either rise or fall based on whether they believed in Jesus. Simeon refers to Jesus as the Lord’s “salvation” which He prepared not only for Israel, but before the face of all peoples. Though some would believe in Jesus and be saved from their sins, many more would reject Him and perish. He also prophesied of a difficult time ahead for Mary. The sword that would pierce her own soul is probably a reference to the hurt she experienced when Jesus was rejected and crucified.