Ānanda, there are these eight liberations. What eight? Having physical form, they see forms. This is the first liberation. Not perceiving form internally, they see forms externally. This is the second liberation. They’re focused only on beauty. This is the third liberation. Going totally beyond perceptions of form, with the disappearance of perceptions of impingement, not focusing on perceptions of diversity, aware that ‘space is infinite’, they enter and remain in the dimension of infinite space. This is the fourth liberation. Going totally beyond the dimension of infinite space, aware that ‘consciousness is infinite’, they enter and remain in the dimension of infinite consciousness. This is the fifth liberation. Going totally beyond the dimension of infinite consciousness, aware that ‘there is nothing at all’, they enter and remain in the dimension of nothingness. This is the sixth liberation. Going totally beyond the dimension of nothingness, they enter and remain in the dimension of neither perception nor non-perception. This is the seventh liberation. Going totally beyond the dimension of neither perception nor non-perception, they enter and remain in the cessation of perception and feeling. This is the eighth liberation. These are the eight liberations.
When a mendicant enters into and withdraws from these eight liberations—in forward order, in reverse order, and in forward and reverse order—wherever they wish, whenever they wish, and for as long as they wish; and when they realize the undefiled freedom of heart and freedom by wisdom, and live having realized it with their own insight in this very life due to the ending of defilements, they’re called a mendicant who is freed both ways. And, Ānanda, there is no other freedom both ways that is better or finer than this.” That is what the Buddha said. Satisfied, Venerable Ānanda approved what the Buddha said.
Long Discourses 16 The Great Discourse on the Buddha’s Extinguishment