A three-year-old girl was found dangling by her neck from a fourth floor window grill after her parents left her alone to go to work.
Passersby heard Chyou Wang's cries after she became stuck in the grill, which is designed to stop burglars.
The distressed girl was eventually freed by emergency services in the city of Guilin in Guangxi Zhuang, China, after they broke into the flat.
Firefighters had to widen the bars while holding onto the girl before easing her free.
Her parents said she must have got bored or gone to look for them and somehow managed to open the window by herself.
When she got outside, it is believed she slipped and was only prevented from falling four storeys to the ground by her head.
Her dad Lian, 44, said: "We never imagined something like this could have happened. We are so grateful that it worked out well in the end." Her parents have promised not to leave their daughter on her own in future.