I have heard that on one occasion the Blessed One was staying near Rājagaha in the Maddakucchi Deer Reserve. Now at that time his foot had been pierced by a stone sliver. Excruciating were the bodily feelings that developed within him—painful, fierce, sharp, wracking, repellent, disagreeable—but he endured them mindful, alert, & unperturbed. Having had his outer robe folded in four and laid out, he lay down on his right side in the lion’s posture—with one foot placed on top of the other—mindful & alert.
Then Māra the Evil One went to the Blessed One and recited this verse in his presence:
“Are you lying there in a stupor, or drunk on poetry? Are your goals so very few? All alone in a secluded lodging, what is this dreamer, this sleepy-face?”
The Buddha:
“I lie here, not in a stupor, nor drunk on poetry. My goal attained, I am sorrow-free. All alone in a secluded lodging, I lie down with sympathy for all beings. Even those pierced in the chest with an arrow, their hearts rapidly, rapidly beating: even they with their arrows are able to sleep. So why shouldn’t I, with my arrow removed? I’m not awake with worry, nor afraid to sleep. Days & nights don’t oppress me. I see no threat of decline in any world at all. That’s why I sleep with sympathy for all beings.”
Then Māra the Evil One—sad & dejected at realizing, “The Blessed One knows me; the One Well-Gone knows me”—vanished right there.
See also: SN 1:38; SN 5:1–10; SN 36:6; AN 5:129
Source https://www.dhammatalks.org/suttas/SN/SN4_13.html which has the following copyright: https://creativecommons.org/licenses/by-nc/4.0/ The author of www.dhammatalks.org also states: “There is some uncertainty about the meaning of ‘Commercial’ with regard to the CC NonCommercial License. For example, some consider the sale of content to support a non-profit entity to be ‘NonCommercial.’ The author and copyright holder of the content on this site considers any sale, including by non-profit entities for non-profit purposes, to be ‘Commercial’ and a copyright violation.“