MANAGUA Victor Toruno was just 12 when he ran away from an abusive father to join a local street gang in Nicaragua, graduating from thief to drug dealer.
After stints in jail and treatment and therapy for drug addiction, he took part in a rehabilitation and training program run by a charity group and now runs a small bakery in Managua where he employs other youths who have escaped gang life.
It is a far cry from the fate of 17-year-old Jorge who lives just 150 miles (240 km) away in neighboring Honduras, surrounded by gang members in a neighborhood where nine people were murdered in three months, including a 22-year-old relative.
Jorge rarely ventures out into the streets and dreams of riding a migration wave north to the United States.
For relative neighbors, they live worlds apart.
Both countries are among the most impoverished in the Americas, but Honduras is also blighted with the world's highest murder rate, at 90.4 homicides per 100,000 people, according to the United Nations, while Nicaragua's rate is just 11.3.
Crushing poverty and extreme violence - fueled by drug trafficking and police corruption - are behind a mass migration of Central American children to the United States in recent months that has overwhelmed U.S. border resources and driven illegal immigration to the fore in U.S. congressional elections.
But Nicaragua is an odd man out in the region. It is even poorer than Honduras, Guatemala and El Salvador -- which account for the vast majority of child migrants -- but it has largely fended off the drug gangs terrorizing those countries and it sends few migrants north.
Nearly 16,000 unaccompanied Honduran minors have been caught trying to sneak into the United States since October, versus just 194 Nicaraguans.
The left-wing Sandinista rebels who overthrew a U.S.-backed dictator in 1979 went on to build more efficient and less corrupt security forces and they have avoided the tough crackdowns seen elsewhere, instead focusing more attention on social programs that help get youths out of gangs.
Toruno, who is now 27, said he turned his back on a life of crime four years ago when it started to feel lonely as most people around him were law-abiding and gang members were a minority.
Baking cakes and bread in the modest one-room wood and zinc sheet home he rents in a poor neighborhood, Toruno says he now earns more than he did as a criminal and is grateful to the charity that helped train him.
"I said, 'What have I got to gain from a life of crime? To be mutilated, killed, end up in the cemetery?'" he said, bags of flour piled up on the floor and a small television playing across the room he shares with his wife and two kids.
Nicaragua is the second-poorest country in the Western Hemisphere, after Haiti, with more than two-thirds of its people living on $4 a day or less, according to the World Bank.
To be sure, poverty pushes many Nicaraguans to migrate to find better jobs, but the majority head south to wealthier Costa Rica to work in construction or picking coffee and fruit instead of heading north to the United States.
It is quicker, cheaper and safer to cross the border into Costa Rica and there are fewer well-established centers of Nicaraguans living in the United States, so it is tougher for new migrants to make a life there.
Toruno traveled to Costa Rica when he was trying to break out of his gang, but he failed to find work. He was arrested for armed robbery and sent back to Nicaragua, where he was sent to prison for a separate crime before opting to go straight.
"When I decided to quit, many others decided to quit too, because they could see it was the right thing to do ... Everyone opens the doors of their homes to me now, they greet me instead of turning around and running."In the Honduran capital of Tegucigalpa, Jorge, who declined to give his surname for fear of reprisals from gang members, has started saving up to pay for the long journey across Mexico to the United States. He has socked away just over $100 so far.
He lives in a modest breeze block home with a metal door behind a 2-meter high wall in a volatile neighborhood. Firefights are commonplace and taxi drivers pay "tolls" to gangs just to work in the area.
"I don't see any future here, I don't have a job and I live in fear," said Jorge.
His miserable prospects mirror those of tens of thousands of unaccompanied migrant children from Guatemala, El Salvador and Honduras who have fled to the United States.
In those countries, gangs control entire neighborhoods where police only enter in heavily armed patrols. Violence has increased as Mexican drug traffickers spread their operations to the region in recent years.
While way behind Honduras, both El Salvador and Guatemala have very high murder rates of around 40 per 100,000 people.
Part of the difference can be attributed to U.S. policies from decades past. Central America's wars between leftist guerrillas and U.S.-backed right-wing governments drove a surge of refugees to the United States.
Young immigrants in Los Angeles and other cities joined street gangs. When the United States deported almost 46,000 convicts back to Central America between 1998 and 2005, the gangs grew and spread rapidly across the region.
In El Salvador and Honduras, governments adopted "iron fist" policies and jailed thousands of youths as gang members, often on flimsy evidence of gang association. Experts blame the crackdowns for deepening violence.
"What really made the difference is what the Nicaraguan police have not done. They have been much less repressive in dealing with gangs," said Jose Luis Rocha, an expert on Central American youth gangs and migration.
Although President Daniel Ortega is accused by opponents of being an autocrat, the United Nations has praised Nicaragua's security model, which includes social services to help youths in gangs find jobs as well as sport programs like little-league baseball teams. Such opportunities are scarce in Central America.
Cheap oil shipments from socialist ally Venezuela allow Ortega to finance anti-poverty programs, such as replacing thatched roofs with metal or trucking subsidized red beans, the national staple, into poor neighborhoods across the country.
NICARAGUA A MAGNET?
Iveth Espino, a coordinator of community projects at the Center for the Prevention of Violence who helped Toruno turn his life around, says Nicaraguan gangs are less hierarchical and organized than their peers in Honduras and El Salvador.
"The gangs weren't allowed to evolve," she said. "One way or another, via different programs, we put a halt to the situation and involved the whole community, schools, police, community leaders, so that youths see that they are not alone."
The relative peace of Nicaragua is even drawing some immigrants from its wealthier neighbors.
On the outskirts of San Pedro Sula, Honduras' most violent city, Julio Cesar Gutierrez, 26, is struggling to find work. He recently returned from a two-month stay in Nicaragua where he and a friend worked for an electricity company.
Now he plans to return to Nicaragua, saying it's a safer option than heading north to the United States.
"I would love to be there (in the United States) but I would not like to experience what happens on the way there ... It's a long and dangerous road."
(Additonal reporting by Gustavo Palencia in Tegucigalpa, Gabriel Stargardter in San Pedro Sula and Simon Gardner in Mexico City; Writing by Michael O'Boyle; Editing by Simon Gardner, Kieran Murray and Ross Colvin)