Starved and beaten by his stepmother, the little boy with big brown eyes was already withdrawn and unhappy by the time his father banished him from the family home and sent him to an orphanage in the Afghan capital, Kabul.

There, the beatings and the abuse continued, this time by older boys, and it took a while before a teacher at school noticed just how much in pain the 10-year-old was and slowly got him to tell her his story.

The boy's mother had become sick and died, he said, and when his father remarried, the new wife took against the boy and his sister, often beating them, and withholding food for days on end.

It would have been an all too common story in Afghanistan had not the teacher reached out to a parliamentarian, who got in touch with a government rights commission, which then contacted a non-government organization that in turn provided a lawyer — and after a complicated cascade of events the boy was eventually brought to a shelter run by Hagar International, the NGO.

After almost four decades of war, two generations of Afghans have no experience of life without a backdrop of brutality. The 10-year-old was one of the lucky few to escape what can appear to be a never-ending cycle of violence.

Human rights officials and those working with abandoned, orphaned or unwanted children say up to 6.5 million Afghan children live in danger of abuse. The country, with an estimated population of around 30 million, has had much of its services devastated by the conflict and has little capacity to care for them.

On a recent visit to the Hagar shelter for vulnerable minors in Kabul, The Associated Press gained access to a tiny fraction of those children. With the permission of the shelter managers — who are the children's legal guardians — and with the consent of the 10-year-old himself, the AP talked to the boy about his life since his father sent him away. It is the AP's policy not to identify minors who have been subjected to abuse.

The shelter, in the western suburbs of the capital, is one of two in Kabul run by Hagar International, which for the past five years has aimed to provide a range of services for children who have suffered extreme abuse.

Many are not orphans in the traditional sense. They still have a parent living — but one who is not willing or financially capable of caring for the child.

At Hagar, many of the children experience education for the first time and acquire skills that could one day help them earn a salary. But most importantly, they learn that their lives have value and they are treated with dignity, said Sara Shinkfield, Hagar's country director in Afghanistan.

"One of the difficulties in this job is that every day, we are meeting clients who have been through hell, they have been through the worst that life can offer, they have been treated without dignity, they have been treated as less than human," said Shinkfield.

Currently Hagar is caring for more than 40 women and children, boys and girls, at its two Kabul shelters. The children study and have classes as they would in school — mathematics, geography, history, along with English and computers. There is time for play and they are regularly taken on field trips.

In recent months, groups from the shelters visited the city's only amusement park, the Green Park, as well as Kabul's famous Babur Gardens, the National Museum and the National Archive. They also have drawing and painting classes — their artwork often revealing the profound pain they have suffered and in many cases, still keep hidden.

According to Najibullah Zadran Babarakzai, national coordinator for the rights of children with the Afghanistan Independent Human Rights Commission, Afghan children are on the verge of a humanitarian crisis and desperately need more of everything, including shelters.

"Between 6 million and 6.5 million children in Afghanistan are either directly in danger or are slowly moving toward danger," Babarakzai said. Few independent or government organizations focus on children's issues or provide shelters for victims of violence and other abuse, he said.

In a country like Afghanistan where more than half of the population lives in abject poverty, the dangers are many, he said, listing trafficking, rape, forced marriage, prostitution and domestic violence among a plethora of threats.

Children who are victims of abuse and violence often become abusers themselves, Babarakzai said. Treating these children and helping them come to terms with their experiences, rather than internalizing their pain, can help them develop into normal, insightful adults.

Hamidullah Habib, the director of the government's child protection services at Action Network, says that in Kabul, a city of more than 4.5 million people, there are only 20 children's shelters — all with a limited capacity and expertise for treating traumatized minors.

"They are very good partners with the Afghan government in providing assistance to children in need," Habib said of the existing services. "But unfortunately, their projects are based on foreign funds. So when the funding ends, the project is over."

Outside Kabul, the situation is even more dire, he said.

With the withdrawal at the end of last year of international combat troops and much of the international NGO presence, Afghanistan now faces an economic crisis that is expected to exacerbate poverty, which is likely to perpetuate the violence that afflicts the desperate across the country. Afghanistan is one of the poorest countries in the world, and is regularly listed as one of the worst to be a woman because of the level of abuse against women and girls that is generally accepted and rarely dealt with by law.

Since the foreign forces left and Afghanistan was no longer the primary focus of global charities and governments, many organizations like Hagar have been struggling for the same share of the ever-shrinking funding pot, said Shrinkfield.

"I think you could have 100 organizations and still it wouldn't be enough," she added.

Meanwhile, the progress made by the brown-eyed boy who was brought to Hagar is a rare success story. After a year of treatment and care at the shelter, he now lives with an uncle, attends a private school paid for by Hagar, and is making plans for his own future.

"I want to become a doctor, because if anyone gets sick I will give him medicine," he said on a visit to Hagar, a big smile lighting up his face.