Genesis 41:46 - From the Pit to the Palace

And Joseph was thirty years old when he stood before Pharaoh king of Egypt. And Joseph went out from the presence of Pharaoh, and went throughout all the land of Egypt.
After 13 years of bondage Joseph stood before Pharaoh king of Egypt just as David stood before King Saul; they were liked immediately and made to be the king's right-hand man (Genesis 37:2; 1 Samuel 16:21).