With regard to the historical basis of this story, Nelson says: ‘From what we know of Darius and the Persian kings, it seems incredible both that the king would be duped by his advisers and that he would make an edict requiring such a narrow religious practice. The story may contain a historical kernel about a faithful Jew who was delivered from death, but the final account seems to be fashioned as a well-told story rather than as a historical record.’

Nelson adds: ‘If the book of Daniel was written in the second century B.C., the story of the lions’ pit was likely included because of its relevance to the Jews suffering persecution at the hands of Antiochus IV.’

But Baldwin cites G. J. Wenham to the effect that ‘a book of old, authentic stories would have provided comfort to sufferers of later generations far more convincingly than a book of new parables (cf. Heb. 11, especially verses 33, 34).’

1 It pleased Darius to appoint 120 satraps to rule throughout the kingdom, 2 with three administrators over them, one of whom was Daniel. The satraps were made accountable to them so that the king might not suffer loss. 3 Now Daniel so distinguished himself among the administrators and the satraps by his exceptional qualities that the king planned to set him over the whole kingdom. 4 At this, the administrators and the satraps tried to find grounds for charges against Daniel in his conduct of government affairs, but they were unable to do so. They could find no corruption in him, because he was trustworthy and neither corrupt nor negligent. 5 Finally these men said, “We will never find any basis for charges against this man Daniel unless it has something to do with the law of his God.”
6 So the administrators and the satraps went as a group to the king and said: “O King Darius, live forever! 7 The royal administrators, prefects, satraps, advisers and governors have all agreed that the king should issue an edict and enforce the decree that anyone who prays to any god or man during the next thirty days, except to you, O king, shall be thrown into the lions’ den. 8 Now, O king, issue the decree and put it in writing so that it cannot be altered—in accordance with the laws of the Medes and Persians, which cannot be repealed.” 9 So King Darius put the decree in writing.

Darius, according to Baldwin, is ‘none other than Cyrus the Persian, using what may well have been his enthronement name during the first year of his reign.’

The lion’s den – In the Ancient Near East, lions would often be captured or corralled, in order to provide sport for kings.  So there is nothing intrinsically improbable about Daniel being thrown in to the pit (or ‘pen’ or ‘enclosure’) with them.  According to Brent Strawn, the idea of being ‘thrown into the lion’s den’ already had a metaphorical meaning in those days, and he thinks that it might carry such a meaning here.  Strawn concludes: ‘Perhaps the author of Daniel misunderstood the metaphorical nature of the motif and “literalized” it. Then again, maybe it is no flat-footed misunderstanding at all but an intentional literary device demonstrating how, with God’s help, Daniel triumphed over all sorts of “lions”—the metaphorical ones in the Babylonian and Persian courts (Dan 1-6) and the real ones in the “lions’ den.”’

10 Now when Daniel learned that the decree had been published, he went home to his upstairs room where the windows opened toward Jerusalem. Three times a day he got down on his knees and prayed, giving thanks to his God, just as he had done before. 11 Then these men went as a group and found Daniel praying and asking God for help. 12 So they went to the king and spoke to him about his royal decree: “Did you not publish a decree that during the next thirty days anyone who prays to any god or man except to you, O king, would be thrown into the lions’ den?”
The king answered, “The decree stands—in accordance with the laws of the Medes and Persians, which cannot be repealed.”
13 Then they said to the king, “Daniel, who is one of the exiles from Judah, pays no attention to you, O king, or to the decree you put in writing. He still prays three times a day.” 14 When the king heard this, he was greatly distressed; he was determined to rescue Daniel and made every effort until sundown to save him.
15 Then the men went as a group to the king and said to him, “Remember, O king, that according to the law of the Medes and Persians no decree or edict that the king issues can be changed.”
16 So the king gave the order, and they brought Daniel and threw him into the lions’ den. The king said to Daniel, “May your God, whom you serve continually, rescue you!”
17 A stone was brought and placed over the mouth of the den, and the king sealed it with his own signet ring and with the rings of his nobles, so that Daniel’s situation might not be changed. 18 Then the king returned to his palace and spent the night without eating and without any entertainment being brought to him. And he could not sleep.
19 At the first light of dawn, the king got up and hurried to the lions’ den. 20 When he came near the den, he called to Daniel in an anguished voice, “Daniel, servant of the living God, has your God, whom you serve continually, been able to rescue you from the lions?”
21 Daniel answered, “O king, live forever! 22 My God sent his angel, and he shut the mouths of the lions. They have not hurt me, because I was found innocent in his sight. Nor have I ever done any wrong before you, O king.”
23 The king was overjoyed and gave orders to lift Daniel out of the den. And when Daniel was lifted from the den, no wound was found on him, because he had trusted in his God.

As Harper’s Bible Commentary observes, ‘In many respects the conclusion of this story can be described as a passion narrative hauntingly similar to the great passion account of Jesus in the synoptic Gospels. The king, like Pilate, is uneasy about condemning this man to death because he is blameless (v. 22). However, the crowd of learned doctors and important people demands that the law of the empire be followed, and the hero is condemned to death. Nonetheless, the king’s conscience remains guilty about the matter. Daniel is put in the place of death, and then after a time (in his case one day, not three) he emerges alive from the pit of death because he trusted God (v. 23). A major difference, of course, is that Daniel did not die because “God sent his angel and shut the lions’ mouths” (v. 22, RSV).’

24 At the king’s command, the men who had falsely accused Daniel were brought in and thrown into the lions’ den, along with their wives and children. And before they reached the floor of the den, the lions overpowered them and crushed all their bones.
25 Then King Darius wrote to all the peoples, nations and men of every language throughout the land:

“May you prosper greatly!

26 “I issue a decree that in every part of my kingdom people must fear and reverence the God of Daniel.

“For he is the living God
and he endures forever;
his kingdom will not be destroyed,
his dominion will never end.
27 He rescues and he saves;
he performs signs and wonders
in the heavens and on the earth.
He has rescued Daniel
from the power of the lions.”

28 So Daniel prospered during the reign of Darius and the reign of Cyrus the Persian.

The reign of Darius and the reign of Cyrus the Persian – Or, ‘the reign of Darius, namely, the reign of Cyrus’, making them one and the same person.  Such an construction occurs elsewhere in the book.  This is the view of Wiseman, Baldwin, and some others.