I saw Allah's Messenger (ﷺ) lying on his back in the mosque and putting one of his legs over the other.

Sahih al-Bukhari Book 79, Hadith 59