2 Chronicles - Chapter 22

In the story of the birth of Jesus we read about the attempt by King Herod to have him killed.  Mary and Joseph take Jesus to Egypt, out of Herod's reach, and they remain there until after the death of King Herod.

We read in 2 Chronicles 22 of a similar attempt to kill one  of Jesus' royal ancestors, Joash.  This attempt to wipe out the royal line of David was unsuccessful, as Joash was hidden away.

"When Athaliah, the mother of King Ahaziah of Judah, learned that her son was dead, she began to destroy the rest of Judah’s royal family. But Ahaziah’s sister Jehosheba, the daughter of King Jehoram, took Ahaziah’s infant son, Joash, and stole him away from among the rest of the king’s children, who were about to be killed. She put Joash and his nurse in a bedroom. In this way, Jehosheba, wife of Jehoiada the priest and sister of Ahaziah, hid the child so that Athaliah could not murder him. Joash remained hidden in the Temple of God for six years while Athaliah ruled over the land."