A dangerous situation resulted in a happy ending after a four-year-old girl left her Scarborough home in the middle of the night and wandered onto outdoor TTC tracks used by subway trains.

“She's known for this. I mean, she gets excited when she wants to go outside,” the girl’s mother, who doesn’t want to be identified, told CTV News Toronto Thursday afternoon.

Toronto police received a call for reports that a young girl was missing from her home on Thursday, at around 1:30 a.m.

The girl and her younger sister reportedly unlocked the door and then the four-year-old walked out of the home.

“I have a little baby (the sister)… she opened a safety lock on the handle and cracked it open. And I guess my daughter that has autism saw that the handle was off and took the approach to move a dining chair to the back door and climb up and pull the two sliding locks,” the mother said.

The girl was missing for about 20 minutes before her mother alerted police.

“I couldn't focus. I couldn't process it. Everything was going through my head because I'm like ‘she doesn't know what she's doing. She has no idea about what she was doing.’ I had no clue of where she could have went,” the mother said.

Shortly after police responded, they received a call from the TTC that the child was found wandering on train tracks at Warden Subway Station, located at Warden and St. Clair avenues.

The family lives a short walking distance from the station and the mother believes her daughter went through their backyard fence into a path that led to the tracks.

TTC spokesperson Stuart Green said the child was spotted at track level by a train operator driving a train towards her.

"Leaving Warden Station toward Victoria Park Station it's an open cut area. So for people that aren't familiar, it's just wide open there. There is a lot of fencing along the side, there are signage and all sorts of things advising to stay off the tracks, but it is exposed to the outdoors," Green told CP24 Thursday morning.

The operator stopped the train and called transit control to cut the power at the track level.

Green said that was necessary as the child was walking along boards over the power rail, which had 600 volts running through it.

Once the power was cut, the operator retrieved the child and brought her on board the train, Green said.

The train then reversed back into Warden Station where her mother and police were waiting.

The child sustained no injuries and is in good health, police said.

The TTC said the train was out of service at the time of the incident and no passengers were on board.

No charges have been laid but police said safety advice was given to the parents.

The mother said this is not her daughter’s first time unlocking doors and leaving the home, which prompted the family to add a total of seven locks to their doors.

“I just gotta keep her tied to my waist. There's nothing I can do until I get out of here. Looking to move, yeah, because I don't think it's safe. And I don't like the idea of if she goes missing again or if she tries to escape again she's in the forest or she could end up right back here near the train,” she said.

Green said it’s not clear how the child entered the tracks, which are surrounded by fencing in the area.

"We've checked the CCTV cameras. We checked the fencing last night in the immediate area. We didn't see any gaps in the fence. We couldn't see anything on the video that would suggest how the child got access. But we're looking further into that today," Green said.

Green added that the train operator's "heroic" efforts prevented a tragedy from occurring.

"They (the conductor) were probably a bit shaken last night when this happened. But you know, really did heroic work. I mean, it may sound like a simple thing to stop a moving subway train and bring a child off the tracks onto the train. There's a lot of danger involved in this," Green said.

Just over two weeks ago, a four-year-old girl in Mississauga was killed after she walked onto train tracks and was struck by a GO train. Neighbours in that case said they had previously complained about a lack of barriers preventing pedestrians from entering the track area.