Onlookers filmed the dangerous play from a hospital in front of the building in Chile.
According to Manuel, an eyewitness who was in the hospital with his son waiting to see a doctor, the girl was playing on the ledge outside a fifth-floor window, about 12 metres from the ground.
The ledge was not walled and did not have a rail, and the youngster was occasionally leaning over the edge with her doll.
Footage shows the girl playing on the precarious ledge at Renaca, in the coastal resort of Vina del Mar, in the central region of Valparaiso.
At one point she dangled her leg over the edge before eventually crawling back through the window where she came from.
A hospital doctor attending Manuel’s son saw the alarming scene and immediately called the police.
“There were people with the girl [inside the property] including her mum, but she was apparently talking on the phone,” Manuel said.
He added that he believed the girl has Down syndrome.
It is unclear how long the young girl was playing on the ledge, but Manuel saw her for several minutes.
It was not clear whether local authorities are investigating the incident.