For Adam the Sabbath had a peculiar significance. When he was made to depart out of Paradise in the twilight of the Sabbath eve, the angels called after him, "Adam did not abide in his glory overnight!" Then the Sabbath appeared before God as Adam's defender, and he spoke: "O Lord of the world! During the six working days no creature was slain. If Thou wilt begin now by slaying Adam, what will become of the sanctity and the blessing of the Sabbath?" In this way Adam was rescued from the fires of hell, the meet punishment for his sins, and in gratitude he composed a psalm in honor of the Sabbath, which David later embodied in his Psalter.
Adam Was Expelled from Eden Just Before Shabbat
Legends of the Jews 2:81