This is how the birth of Jesus came about. When Jesus’ mother, Mary, was engaged to Joseph, but before they lived together, she was found to be pregnant through the Holy Spirit. Joseph, her husband, an upright person unwilling to disgrace her, decided to divorce her quietly.
This was Joseph’s intention when suddenly the angel of God appeared in a dream and said, “Joseph, heir to the house of David, don’t be afraid to wed Mary; it is the by the Holy Spirit that she has conceived this child. She is to have a son, and you are to name him Jesus – ‘Salvation’ – because he will save the people from their sins.”
All this happened to fulfill what God had said through the prophet: “The virgin will be with child and give birth, and the child will be named Immanuel”- a name that means “God is with us.”
When Joseph awoke, he did as the angel of God had directed, and they went ahead with the marriage.