After the wise men were gone, an angel of the Lord appeared to Joseph in a dream. "Get up and flee to Egypt with the child and his mother," the angel said. "Stay there until I tell you to return, because Herod is going to try to kill the child."
That night Joseph left for Egypt with the child and Mary, his mother,
and they stayed there until Herod's death. This fulfilled what the Lord had spoken through the prophet: "I called my Son out of Egypt."
References for Matthew 2:15