(CNN) -- He's still a teenager, but Wilfredo Vasquez has already seen plenty in his life.
His story begins in Anamoros, a city in southeastern El Salvador. At 16, alone, living in poverty, threatened by violent gangs in his neighborhood and practically abandoned by his parents, Vasquez decided to leave everything behind and migrate to the United States.
"If you didn't join the gangs, they would kill you," Vasquez says, "and I didn't want to join because I knew if I did it, I could die very soon." By the time he left, he had managed to save $100.
Vasquez traveled by bus through Guatemala and crossed the Suchiate River illegally into Mexico. He then boarded a bus for the U.S. border. At one point, he says he was detained by Mexican soldiers and questioned. His Salvadoran accent betrayed him, but somehow he was let go. It took the teenager two weeks to get to the Texas border, eating at bus stations and sleeping wherever he could.
With the help of older immigrants, Vasquez says he swam across the Rio Grande, reaching Texas and American soil for the first time. His only belongings were the clothes he was wearing and a few dollars in his pocket.
He was detained by immigration authorities near Houston and sent to a detention center where he would spend three months before being released to the custody of a relative living in Georgia.
Vasquez is now a permanent resident in the United States, thanks to a little-known immigration law that helps undocumented minors arriving alone in this country.
The law, officially known as Special Immigrant Juvenile Status, was first enacted by Congress in 1990. In 2008, that law was expanded and reauthorized under new legislation.
According to the Department of Homeland Security, "the purpose of the SIJ program is to help foreign children in the United States who have been abused, abandoned, or neglected." Minors who are approved can live and work permanently in the United States.
Rebeca Salmon is an immigration attorney and the executive director of Access to Law, an organization that provides low-cost legal services. Salmon says that applying for this immigration benefit is difficult because you have to prove your case at the state and federal level.
"Not every kid that applies gets to stay. Not every kid who enters can even apply. You have to be abandoned, abused and neglected. You have to be without your parents. There are minimum requirements, but then there's also the rigorous process of immigration, so not every kid gets to stay," Salmon said.
Tens of thousands of unaccompanied minors have arrived to the United States this year, mainly from Central America. But Salmon says very few can actually qualify for this immigration benefit, unlike Vasquez, who was able to prove he was the victim of abuse, abandonment or neglect.
"If that's the only message you get out through this, please make sure that's clear. If you send your kids here or kids come on their own, you're fleeing something in your country, every case is different and every case is difficult," Salmon said.
She estimates that only about 10% of the estimated 60,000 children who have migrated to the United States in the last year alone are eligible for this immigration benefit, and of those, only a fraction can actually prove their case in court. The rest will be deported, she says.
Those minors who qualify under this provision of the law and get approval can obtain a green card, which allows them to stay in this country and have legal status in the United States. They can then apply for citizenship after five years of living here if they have not committed any crimes, have learned English and can demonstrate a basic level of knowledge of American history and government.
Vasquez turned 18 earlier this year. He's learning English in high school and getting good grades.
"My dream is to graduate from high school and then go to college because I want to be a doctor," Vasquez said, quite an improvement for a young man whose goal as a child was merely to stay alive.