Sun Yixiao was on his way up last Tuesday evening after school, when the lift suddenly lurched to a stop.
A moment of panic followed, before the teenager decided to take matters into his own hands and find a way out.
Sun said he tried to pry open the elevator door, but dismissed the idea and instead leaned against the wall concerned there could be a malfunction that would send the elevator in a free fall.
He then pressed all the buttons in the hope to get the elevator to work again, but to no avail. Sun then punched the "stop" button, to lock the elevator and secure it won't move.
Without a cellphone at hand, Sun tried yelling to get the attention of people outside, but no one responded as time passed by.
But the young boy still had on last trick up his sleeve before surrendering.
He slipped a note through the door with the message "People stuck inside, please ask the property management for help," and hoped someone would pick it up and act on it.
After exhausting all his options, the practical kid decided to tend to his academic responsibilities, not knowing how long it would take before someone finds him.
He took out his textbooks and busied himself with his daily homework routine.
Soon after he finished his duties, Sun heard loud voices coming from outside.
"There was a large crowd outside, including my teachers and other parents, people looked quite agitated," Sun said of the moment he was rescued.
He had been stranded for five hours by the time help arrived.
On China's Twitter-like Weibo, many netizens thumbed up the boy's bravery and calmness in the face of such emergency.
"The guy must have weighted the pros and cons of the situation: he had a great chance to survive a stranded elevator, but would have been doomed if he left homework undone," joked @Zealshifang.