MEDELLIN, Colombia (Thomson Reuters Foundation) - On the upper reaches of one of Medellin's poorest hillside slums overlooking a warren of tin-roofed shacks, scores of residents lug wheelbarrows and mix cement as two gang members speed by on a motorbike.
The slum dwellers are helping to create a network of paved paths and steps, vegetable allotments and drainage canals that will wrap around Colombia's second city. The green belt will act both as a buffer to contain further slum sprawl and a forested park through which residents can stroll and cycle.
It's the latest in a series of initiatives by the mayor's office over the past decade focused on once no-go slum areas -- helping Medellin to rebrand itself from a "murder capital" ruled by drug cartels to a city in the vanguard of urban regeneration.
"I'm proud to be part of this change and make my community better. It's something I can tell my children and grandchildren I did. And it gives me a job," said gardener Kelly Ossa, taking a break from the hot midday sun.
The city is no longer at the mercy of Medellin native and drug lord Pablo Escobar after the demise of the world's largest cocaine cartel following his death in 1993.
But other organized crime groups, like the Envigado Office, which traces its roots back to Escobar, along with new gangs linked to former right-wing paramilitaries, hold sway in many poor areas where residents are deeply suspicious of authorities.
Winning over skeptical residents, as well as the gangs, is key to a transformation seen across the city: once neglected slum areas now boast landscaped parks, open-air gyms, schools, playgrounds and community halls where youth orchestras play.
In the precipitous Comuna 13 neighborhood, free electric escalators run alongside rows of brick and wood shacks with brightly painted facades, saving residents a steep climb.
Perched on another hillside slum, three monolithic black boulders known as the 'Spanish' library house an art gallery, auditorium and reading rooms - another conspicuous example of Medellin's makeover.
"I like doing my homework here. It's quiet and the internet and computers are free," said teenager Sara Renteria, who has been using the library most days since it opened in 2007.
To get there, she hops on the cable car, a public transport system introduced in 2004. Connected to a spotless metro, cable cars ferry nearly 40,000 people a day from the hillside shantytowns to the downtown below in less than 15 minutes.
How cities like Medellin improve life for the urban poor, integrate slums with other parts of the city and curb slum sprawl will come under scrutiny as the United Nations adopts new Sustainable Development Goals this month.
One of the new 17 goals is to make cities safer, more resilient and sustainable, including 'upgrading' slums by 2030 to ensure affordable housing with basic services for all.
The ambitious goal resonates particularly in Latin America, where 80 percent of the population of around 600 million now lives in cities.
After more than a decade of promoting regeneration, Medellin is a city well positioned to achieve this goal and could serve as a model for other cities in Latin American and beyond.
Slums occupy entire hillsides surrounding Medellin, home to around half of the city's 2.5 million residents, including migrants and other families who have fled their rural homes to escape fighting in Colombia's half-century-old war.
Improved security and the demise of Escobar's cocaine empire have seen the city's murder rate plunge by nearly 90 percent from record rates of 380 per 100,000 people in 1991.
Fighting for territorial control in slum areas between the warring factions in Colombia's conflict - right-wing paramilitary groups, government security forces and left-wing FARC rebels - has ebbed in recent years.
Gun battles at night are far fewer and the chances of being hit by a stray bullet lower, residents say.
Despite all this, and the hundreds of millions of dollars injected in slum areas, drug-running armed gangs, or "combos" are still powerful.
"We have combos who reign the streets," says rapper Jeihhco, a community leader, who grew up and lives in Comuna 13, one of Medellin's toughest neighborhoods.
"In our neighborhoods, the state doesn't have control. It's a contradiction that where the police are, they don't call the shots and impose the law."
He and a group of rappers run a local hip-hop school that aims to steer children away from the pervasive gang culture by offering break-dance, graffiti, DJ and rap lessons, attracting around 200 teenagers every week.
But unemployed and poor youths not involved in such projects make easy prey for drug gangs looking to recruit messengers, informants, arms couriers and street drug dealers catering.
Forced recruitment, threats and violence by gangs drove more than 2,000 people from their homes in Medellin last year, according to the city ombudsman's office.
Gangs run extortion rackets, charging residents from street sellers, shop keepers to big businessmen a weekly protection tax, known locally as a vaccine, "vacuna".
"The biggest source of income for the combos comes from extortion," said Kabala, a fellow rapper and Comuna 13 resident.
Criminal gangs also dictate social norms and are known to host community events like pop concerts.
"Obviously there are some rules that you know exist but aren't explicit, like don't mess with anyone, don't argue with anyone, don't fight," Kabala said nonchalantly.
"If they (the gangs) tell you to leave, you leave. If they say stay, you stay. It's about maintaining this harmony."
Like many residents, Kabala views government security forces as corrupt and responsible for abuses. Often slum dwellers seek the help of gang leaders to deal with problems like domestic violence or petty disputes between neighbors over rubbish.
"I tremble when I see the police. I'd rather go to a gang member to sort out a problem than the police," he said.
Gaining the trust of people living in slums, and the tacit approval of gang leaders to undertake renewal programs is a major challenge, government officials say.
Back at the green belt project in the Comuna 8 neighborhood, Joaquin Humberto, who works as a community liaison officer for the mayor's office, says he has received threats from gangs demanding he leave the area.
"At first when people here saw our government identity cards it was hard for them to greet us," said Humberto, standing on a once barren area turned football pitch while children played around him.
"The state was seen more as an enemy than an ally. It was seen as repressive, its only presence was the police who went in with guns," Humberto said.
Over the past two years, he has presided over countless community meetings explaining to residents the benefits and jobs urban renewal can bring, gaining credibility in their eyes.
He said providing training and jobs to 2,500 local residents to work on the green belt project, instead of hiring people living outside of the neighborhood, helped generate trust and a sense of belonging among the community.
"It's complicated, not only convincing people to believe in the state but in themselves too. It's a constant, day by day, minute by minute, process," Humberto said.
Reporting By Anastasia Moloney, Editing by Ros Russell. Please credit the Thomson Reuters Foundation, the charitable arm of Thomson Reuters, that covers humanitarian news, women's rights, trafficking, corruption and climate change. Visit www.trust.org