The Jews visited Egypt in the Bible from the earliest patriarchs (beginning in ), to the flight into Egypt by Joseph, Mary, and the infant Jesus (in ). The most notable example is the long stay from Joseph's (son of Jacob) being sold into slavery in , to the Exodus from Egypt in , during the Second Intermediate Period and New Kingdom. A large number of Jews (such as Jeremiah) also began permanent residence in Egypt upon the destruction of Jerusalem in 587 BC, during the Third Intermediate Period.