It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The Children of Israel appointed a caliph over themselves. (One night) he stood praying in the moonlight on top of Bayt al-Maqdis, and he remembered certain things he had done, so he lowered himself down by a rope. In the morning the rope was hanging from the mosque and he was gone. He went on until he came to some people on the seashore, and he saw them making mud bricks. He asked them: 'How do you get (paid) for these bricks?' They told him, so he made bricks with them. He would eat from the earnings of his own hands, and when the time of prayer came he would purify himself and pray. That labourer reported this to their dihqan (chief) and said: 'There is a man among us who does such and such.' He (the dihqan) sent for him, but he refused to come to him. Then he (the dihqan) came riding on his mount, and when he saw him he ran away. He chased him and overtook him, and said: 'Give me time to say a word to you.' So he stood still until he had spoken to him, and he told him that he had been a king and had fled out of fear of his sin. He said: 'I too will join you in this.' So the two of them worshipped Allah, and they asked Allah to cause them both to die together, and they both died." Sayyiduna Abdullah (may Allah be pleased with him) said: "If I were in Rumaylah of Egypt, I would show you their graves," as the Messenger of Allah (peace and blessings be upon him) described it.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10332