The teachers and students of a school in South Africa got the shock of their lives after finding a deadly snake on the roof of a classroom.

Snake catcher Nick Evans was releasing snakes when he received a call from a teacher saying a reptile was curled up on a roof beam. He rushed to the school along with another snake catcher and found the reptile. Evans confirmed it was a Black Mamba, a highly venomous snake that is native to parts of sub-Saharan Africa.

"The mamba was curled up on a beam, visible through a hole in the roof. It looked a youngster, maybe three years old or so, and less than 2 meters (6 feet)," Evans wrote in a Facebook post.

He immediately picked up his snake tongs and grabbed the reptile’s tail with it. Suddenly, the snake’s head came out, following which he grabbed using the second tong.

"I was stressing that it would move further into the roof and out of sight, into the roof of the next classroom. If there was no hole in the next classroom roof, we'd struggle to get it! Luckily, I reached up, and grabbed its tail with my tongs, before it got away. As expected, the head came out, wondering what or who the heck was grabbing it," he wrote.

Evans, who was standing on a chair, managed to pull the reptile down and grab it with his hands.

"I was standing on a chair, which wasn't giving me the height to be able to reach it, but I managed to pull it down low enough for me to grab it with my hand. Without hurting it, of course. The tail took some time to come out, but it eventually did, and I had all of it in my hands," he wrote.

The snake catcher went on to say that the Black Mamba wouldn’t have harmed anyone and quietly moved away as the species is scared of people.

"Mambas are scared of people, and don't want confrontation. Although with their habitat shrinking, or already being surrounded by human development, they're bound to end up in our properties. If it had slithered in the classroom, it would obviously have been more risky, especially if no one had seen it enter, and someone stepped on it, for example. If someone tried killing it, it would have been even more dangerous. Otherwise, it would just try to hide away, and hope that the humans moved away," he wrote.

A Krabi Pitakpracha Foundation snake handler holds the four-metre (13 feet) king cobra he pulled from a sewer in southern Thailand Representational image of a king cobra Photo: KRABI PITAKPRACHA FOUNDATION / Handout