Several reports said that the girl is believed to have walked to a forest near her home in the village of Pierzwin, as temperatures reached below zero.
More than 200 people searched for the girl before firefighters finally found her crying for her mother. It wasn't clear how Julia became separated from her parents, whose names weren't immediately available.
Grzegorz Szymanski, one of the firefighters who found the little girl, said that if it hadn't been for the dog, she likely wouldn't have survived.
“For the whole night the animal was with the girl, it never left her. Remember, it was five degrees below zero and the child was wet," he told BBC. “This dog is the most important part of this story, he is a hero. It is thanks to this dog that the girl survived the night."
In another interview, he added, "We ran around 500 meters, and there was silence. We stood to listen further and we heard the dog and later the crying of a child. We went in the direction and saw the child lying in the shrubs; she was wet because there was water in the forest.”
Julia was being treated at a local hospital for frostbite, authorities said.
Kazimiera Barczyk, the head of the pediatric ward, said, "This dog, which was with her, most probably kept her warm. It lay down next to her when she fell asleep. She was walking and walking, and fell asleep when she got tired.
"The child was brought just before eight o'clock. At the beginning she was scared of people, and she was in shock. At the moment, her mother is going through a lot of stress.”
This isn't the first case where a dog saved a human.
In 2007, a Chihuahua named Zoey saved the life of a 1-year-old boy by fighting a rattlesnake that tried to attack him in Colorado. The boy was splashing his hands in a birdbath in the backyard at the time.
The Chihuahua was bitten by the snake in the scuffle. The boy’s grandfather, Monty Long, told the Seattle Times, "She [the dog] got in between the snake and Booker, and that's when I heard her yipe."
Luckily, Zoey survived and made a rapid recovery, and the boy was unharmed.