NEW YORK (CBSNewYork) – A 6-year-old girl suffered minor injuries when she got separated from her mother and fell onto the subway tracks Saturday afternoon in Brooklyn.

Police said the child had been riding a southbound D train with a group of people, including her mom and some other kids.

When the train doors opened at the Atlantic Avenue-Barclays Center station, the little girl got off with a friend. As the train started to pull away, she chased after it and fell onto the tracks.

“It appears that in some sort of accident, she was dragged by the train a few feet, and she ultimately falls on the roadbed,” NYPD Capt. Zahid Williams said.

“We were right approaching Atlantic station. The train stopped and sat there for about 30 minutes,” said passenger Makeda Benjamin.

Police said someone alerted workers, and the train was stopped. A Good Samaritan then pulled the child to safety.

“It’s a blessing, it’s a blessing,” Brooklyn resident Shon Hill said.

“You have to be holding your child’s hands at all times. That’s why I’m very cautious. When I come in the train station, I have to definitely make sure that they are right next to me,” said resident Karen Ochieng.

The girl’s mother also went onto the tracks and injured her ankle. They were both taken to Brooklyn Hospital in stable condition.