A security guard saved a young boy’s life after the child jumped from a three-storey window at a kindergarten in China on Thursday morning.

The unidentified boy jumped from the window after he accidentally locked himself inside a toilet. Luckily, the security guard tried to catch the boy due to which the impact of the fall was reduced.

The boy was rushed to a local hospital, where X-rays confirmed he had sustained minor fractures on the forehead. He was under observation and remained hospitalized as of Monday.

Confirming the incident, the Fei County Education Bureau told local media after the boy accidentally locked himself inside the toilet, he opened the bathroom window and climbed over the railing before jumping. The boy took the drastic step despite the teachers comforting him and discouraging him from jumping.

A video of the incident showed the pupil taking a leap from the window ledge. The security guard can be seen holding out his hands to catch the boy before he hits the floor. Another person can be seen standing behind the boy before he jumps from the window. Throughout the video, onlookers can be heard screaming "do not jump."

The incident comes a month after a Chinese teen jumped from a school building and died. The parents of the 14-year-old boy were asked to meet the school principal after he was caught playing poker in the classroom.

Following the meeting with the principal, the boy’s mother slapped him twice, forcing him to take the extreme step.

CCTV footage of the incident showed the mother slapping the boy in the hallway of the building. After the woman walks away, the boy climbs over the railing and jumps from the fifth-floor despite other students trying to stop him.

This incident sparked an online debate among social media users who blamed the mother for not treating the teen properly.

Children's toys and furniture stand in the kindergarten in Sumte, Germany, Nov. 2, 2015. Getty Images/ Sean Gallup