A video posted on YouTube by CGTN shows the boy alone in the elevator. He unzips his fly and urinates, aiming directly at the elevator's control panel. As he zips up and waits to exit the elevator, the doors appear set to open - but they suddenly malfunction and close.
Panicked, the boy tries to press a button before remembering what he has just done and pulling his hand away instantly.
The buttons on the elevator control panel light up at random and go haywire.
Then, suddenly, the lights in the elevator begin to flicker. Within seconds, the elevator is plunged into total darkness.
Watch the surveillance footage below:
According to local media reports, the boy was eventually rescued from the elevator. The incident occurred in southwest China's Chongqing city on Friday.
Reaction to the boy's bizarre stunt on the Internet has ranged from anger to disbelief, with many netizens blaming the boy's parents for his "bratty" behaviour.
"What is he thinking..." asks one person. "It's a wonder he didn't get shocked," notes another.
"His parents should be ashamed of how they educated him," writes a third, prompting demands that the boy's parents pay for the damages caused. Click for more trending news