Sharbat Gula had served a 15-day prison sentence in hospital where she was treated for hepatitis C.
She and her four children were handed over at the border. She later met President Ashraf Ghani in Kabul.
Gula, who is remembered for her haunting green eyes, fled Soviet-occupied Afghanistan as a child.
She and millions of other Afghans sought refuge in neighbouring Pakistan and Iran.
After her arrest in Peshawar, near the border, on 23 October she pleaded guilty to all charges and was fined 110,000 rupees ($1,100).
She could have faced years in prison.
Pakistan has started cracking down on refugees living in the country amid rapidly deteriorating relations with Afghanistan and India.
The celebrated "Afghan Girl" picture was taken by photographer Steve McCurry in 1984 in a refugee camp in north-west Pakistan, during the Soviet occupation of Afghanistan. It led to one of the most recognisable magazine covers ever printed.
He tracked her down 17 years later, living in the Tora Bora region of Afghanistan. Gula later moved back to Pakistan and he kept in touch.
Mr McCurry recently said he had hired a lawyer for her following her arrest.
There are strict restrictions to getting a Pakistani ID card, which is needed for opening a bank account or to buy property.
It has been illegal for non-Pakistanis to have IDs since they were first issued in the 1970s but the law was not enforced.
Related news :