Joseph is pledged to be married to Mary, but she is found to be pregnant through the Holy Spirit before they are together. An angel visits Joseph in a dream and tells him the child is from the Holy Spirit and directs him not to divorce Mary but to name the son Jesus, as he will save people from their sins. Joseph does as the angel commands and takes Mary as his wife, but they do not consummate the marriage until after Jesus is born.