In Surah Al-Burooj, Allah Ta'ala mentions about the people of the trench. Their story is recounted in a hadith reported by Imam Muslim (rah) as follows:
There was an infidel king who lived in bygone times. He had a soothsayer, or according to some narrations, a magician. The infidel king is identified as the ruler of Yemen. His name according to ibn Abbas , was Yusuf Dhu Nuwas, and he lived about 70 years before the birth of Rasulullah . The soothsayer said to the king that he should be given an intelligent boy, so that he could train him in the skill of foretelling or the black magic. Accordingly, the king sent a boy, Abdullah bin Tamir by name, to be trained by the soothsayer.
Whenever the boy went to his teacher, he had to pass by a Christian monk. He followed the true religion of Isa and worshipped Allah. Since the religion of Isa was the true religion in those days, the monk was, in fact, a Muslim. The boy sat with the monk and was very much impressed with his teachings. As a result, he frequented the monk's house and sat with him for long hours before proceeding to his teacher. Ultimately he had accepted Islam. Allah had blessed with such a strong faith that he was prepared to bear any pain and persecution for the sake of Allah. His teacher used to beat him for coming late.
On his way back from the occult teacher, he used to spend some time again with the monk and used to go home late. The family would then beat him up for being late. But he was so keen to have the company of the monk without fear of persecution. Through the blessings of this, Allah had gifted with many miracles [kiramah[.
Once a lion had blocked the path and prevented people from passing. They were perturbed. He picked up a stone and prayed, "Oh Allah! If the religion of the Monk is true, then kill this beast with this stone [so that people may pass]. And if the soothsayer or magician is true, then the beast must not die with my stone." So praying, he aimed at the lion and it died instantly. The news spread amongst the people that the boy possesses wonderful knowledge. A blind man heard about this and came up to him. He requested him to restore his sight. The boy conceded on the condition that he embraces Islam. The blind man agreed. The boy prayed and Allah restored his sight. The blind man became muslim.
The king came to know about these incidents, and he got the boy, the blind and the monk apprehended. They were brought before the king. He got the blind and the monk killed, and ordered that the boy be taken to the summit of a mountain and be thrown from there. But those who had taken him up there fell and died. The boy went home safely. Then the king ordered for him to be drowned in the sea. The boy escaped safely, while the people who took him to the sea were drowned.
The boy then himself told the king how to kill him. He told him to take an arrow from his quiver and place it in his bow, and reciting, "Bismillahi Rabbi" "In the name of Allah, my lord' they should shoot. They did that and the boy finally died. In this way the boy gave his life away, but seeing this the entire nation of the king cried out spontaneously: "We believe in Allah." At this the king was greatly enraged and after consultation with his cabinet, ordered for deep trenches to be dug and filled with fire.
An announcement was made that people should renounce their faith with Allah. If they refuse, they would be thrown into the fiery furnace. Eventually, a woman carrying her infant child was brought to a trench, but she hesitated. Allah granted speech to her child, who said: "O Mother, be steadfast, because you are certainly on the truth." In this way, may people were burned. According to some reports, about twelve thousand people were burned to ashes and, according to other reports, the number is more than this.
In a narration of Muhammed Ibn Ishaq, it is reported that the place where the boy Abdullah ibn Tamir was buried had to be dug up for some important reason during the time of Sayyidina Umar . It was found that the body of Abdullah ibn Tamir was intact and he was sitting up. His hand was placed on his hip joint, where the arrow struck him. Someone moved the hand out from that place, and his wound started bleeding. When the hand was placed back the bleeding stopped. There was a ring in his finger which had the inscription, "Allah is my lord." The governor of Yemen informed Sayyidina Umar about this, and he wrote back in reply: "Bury the body back as it was with his special finger."