A stray dog was lucky to survive after he got stuck inside a bathroom with a leopard for seven hours. The incident, which was caught on camera, took place in the southern Indian state of Karnataka.

According to news outlet Times Now, the leopard had chased the stray dog into the bathroom, which was seen by people living nearby. They quickly locked both the animals inside the bathroom and informed forest officials about the incident.

The dog and the animal were stuck in the bathroom for at least seven hours before forest officials arrived at the scene. Villagers and officials took photos and videos of the animals from the bathroom's window. It wasn't clear who was the owner of the building.

The photos that were circulated online showed the stray dog sitting in one corner of the bathroom, looking terrified, while the leopard was sitting at a distance calmly.

Hundreds of people gathered in the village to witness the bizarre scene. The forest department officials arrived and tried to catch the leopard by using nets and tranquilizers. Officials used an earthmover to access the roof of the bathroom. However, the leopard managed to escape, and its location has not been traced till now.

The dog was rescued safely.

The photos and videos of the incident went viral on social media. Videos show the trembling dog sitting with its tail between its legs after being rescued.

Last month, a woman was mauled to death by a leopard in the Indian state of Uttarakhand. The woman's partially eaten body was found in a forest area. Forest officials had installed three cages in the area after the leopard attacked three other women earlier in January. However, the animal had managed to escape the traps.

"On Tuesday evening, we rushed to the spot on learning about the incident and took into possession the woman's partially devoured body. The leopard has been roaming in the area and this is the fourth incident of attack on women in a month," Mohan Arya, range officer of Jaurasi mountain range in Almora district said, the Hindustan Times reported at the time.