When it is said
It is the last prayer of the night in the Russian prayer book, prayed as you lie down to sleep.
Someone near death may say it too, and those at the bedside can say it with them.
Where it comes from
No author known
The last words before sleep
No one knows who first wrote it or when. Holy Trinity Monastery in New York prints it in its English Jordanville Prayer Book under the words “When giving thyself up to sleep”.
Azbyka.ru prayer book: prayers before sleep (in Church Slavonic and Russian); Holy Trinity Monastery, Jordanville, Prayer Book (2011), on the Holy Wisdom Orthodox Mission website
Words from the cross
It opens with the words of Psalm 31:5, which Jesus prayed as He died on the cross (Luke 23:46). Here a Christian speaks them to Christ Himself, as Stephen did when he prayed “Lord Jesus, receive my spirit” while he was being stoned (Acts 7:59).
What the words mean
Sleep and death
Earlier in the same prayers before sleep, a prayer credited to St John of Damascus is said while pointing at the bed. It asks, “Is this bed to be my coffin, or wilt Thou enlighten my wretched soul with another day?”
Holy Trinity Monastery, Jordanville, Prayer Book (2011): prayers before sleep
The Scripture in it
Then Jesus called out in a loud voice, “Father, into Your hands I commit My Spirit.” And when He had said this, He breathed His last.
Into Your hands I commit my spirit; You have redeemed me, O LORD, God of truth.
While they were stoning him, Stephen appealed, “Lord Jesus, receive my spirit.”
Bible text: Berean Standard Bible, public domain.
In Church Slavonic
В ру́це Твои́, Го́споди Иису́се Христе́, Бо́же мой, предаю́ дух мой:
Ты же мя благослови́, Ты мя поми́луй и живо́т ве́чный да́руй ми. Ами́нь.