Rescue workers spent more than six hours trying to pull Vanessa Mamani from the shaft in a field in Florencio Varela, Buenos Aires province.
She was taken to hospital where doctors said she was shocked but otherwise unharmed by the ordeal.
Argentina’s President Cristina Kirchner has described the rescue as “a miracle”.
“She got out and screamed as if she had just been born,” she told reporters after visiting the girl in hospital.
The rescue operation was broadcast live on Argentine television, as fibre optic cameras showed the small girl trapped in a narrow space at the bottom of the mine shaft, after falling 23 metres.
She appeared unhurt but there were concerns that she might be suffering from less obvious injuries.
The space was too small for anyone to go down and fetch her, so a harness had to be lowered down for her to put on herself.
Chief firefighter Marcelo Tucci said it was unclear until the last moment whether Vanessa would be able to follow the instructions and put on the harness, the Associated Press reports.
But she managed to attach herself and her rescuers erupted in cheers as she reached the surface at around midnight local time (0300 GMT).
Vanessa was then taken to hospital in Florencio Varela. Hospital director Arnaldo Medina said she was suffering “from a state of shock” but was “doing fine”.