The Malaysian budget carrier confirmed this Monday.
A viral video was shared on TikTok. Social media users quickly linked with Samuel L. Jackson's cult classic "Snakes on a Plane". The creature could be seen wriggling around in the cabin's light fittings.
According to the airline, the incident was "very rare" and occurred last week on a flight between Kuala Lumpur, the capital, and Tawau, the eastern coast of Borneo.
AirAsia stated that the captain discovered the snake and took the "appropriate actions" to land in Kuching, 560 miles west from Tawau, so the plane could get fumigated.
They boarded another plane to continue their journey.
Liong Tien Liang, AirAsia's chief safety officer, stated in a statement that "at no time was safety of guests and crew at any danger."
The incident was mocked by social media users as a reminiscence of the 2006 action movie, in which Jackson played an FBI agent who was trapped on a plane filled with venomous snakes.
One user posted, "Snakes on planes are real!" One user shared the following:
Another commentator on Facebook said: "One my worst nightmares. Too frightening for me.
This isn't the first time that a snake was spotted on a passenger aircraft. A snake was spotted on a 2017 flight to Anchorage, Alaska. In 2016, passengers on an Aeromexico flight from Mexico City were shocked by a bright-green snake that dropped out of one of their luggage bins.