The transformation of Medellin must rank as the most remarkable urban redemption project in modern history. Two decades ago this city's very name was a one-word synonym for "murderous-drug-and-crime-ridden-Latin-American-hellhole." The drug baron Pablo Escobar ruled from a hilltop fortress, and his henchmen set off bombs in the middle of the city and executed police in their beds.

And today, in that same neighbourhood from which Mr. Escobar once ran a cocaine empire bringing in $60-million (U.S.) a day?

Slip 'n' slide. Kids keep sneaking into the bathroom in the new community centre and stealing soap in the new community centre to suds up their shorts and slide down the wheelchair ramp into the fountain. There are toddlers playing clapping games in the free early-childhood program, and grannies learning Internet skills in the computer lab.

Story continues below advertisement

The city's richest neighbourhoods are leafy and posh, full of boutiques and bookstores and sidewalk cafés. But its poorest are equally welcoming of strangers these days, humming with commerce and people on their way to work and school.

Medellin used some predictable methods to enact this transformation, including military raids into the most violent neighbourhoods.

More unusually, the city applied principles of epidemiology to track and respond to homicides.

But its government, and many of its residents, attribute the greatest impact to a policy that they call "social urbanism." It boils down to this: the municipal government spends the biggest portion of its budget (85 per cent of $2.2-billion this year) on infrastructure and services for the poorest parts of the city. That spending includes the community programs, and also some truly imaginative public transportation solutions and startling pieces of modern architecture that have been erected in new breathing spaces forced into the once impenetrable hillside shantytowns.

The city has a trophy shelf in danger of imminent collapse for all the international awards it has won, and its residents at all income levels appear immensely proud – although they will tell you, with a bittersweet half-smile, "Medellin paid a price to be so pretty."

The homicide rate peaked here in 1991 at 380 murders per 100,000 people (Toronto's, by way of comparison, was 1.34 per 100,000 last year). It means everyone lost someone.

For the most part, however, they don't want to talk about it. "When you see Medellin, you realize everything is better – it's better now," says Carlos Jaramillo. He is in charge of project support in the Agency for Cooperation and Investment (ACI), the bustling city office charged with selling the new image of Medellin.

Story continues below advertisement

"The biggest asset we have is that our city is known – sadly, for negative things – but our strategy is to rebrand this," said Mr. Jaramillo. "If you check the papers from the 1990s it's drugs, guns, bombs and failed state. Check now – it's social innovation, investment and business."

Mr. Jaramillo and his colleagues – all of them young, their belief in the city unclouded by memories of its dark past – spend their days wooing investors. They can help you get your business registered in 12 days or less, find you office space, get your utilities connected, house your expat staff, help you hire locals and waive your taxes for 10 years. Innovation is their mantra. The word is on so many billboards and repeated so incessantly it starts to be unnerving. They bristle visibly when they heard "violence" in the same sentence as Medellin.

But while the homicide rate has come down 80 per cent in the last 20 years, the gangs are still here – more gangs than there were under Mr. Escobar, who preferred the monopoly model.

After his undignified execution by police, shot dead in his bare feet as he tried to flee over a rooftop, his drug empire was divvied up. Mexican syndicates today control the global cocaine industry; in Medellin, two big gangs share control of trafficking from the jungle down through the city toward the coast and the Mexico connection. They are lower profile, and thus less violent, than the cartels of Mr. Escobar's era, and they exist in an uneasy truce. Smaller gangs manage territories for low-level drug trade and extortion from regular businesses, to the tune of an estimated $2-million a month, according to the National Federation of Small Business.

But these days there are few of the "barreras invisibles" that saw schoolchildren savagely killed for taking a wrong turn into turf declared foreign. "Fifteen years ago you couldn't come here," says Edison Raigosa. "Actually, even two." Mr. Raigosa is the "chief guide" at the community centre in Santo Domingo, the hillside slum that was once Mr. Escobar's main recruiting ground. It was built around a giant water tank, once enclosed by a high wall. Today the centre is packed with kids splashing in the fountain.

"These kids who have art and science workshops and play here – what did they do before? They just hung out in the street all day," said Mr. Raigosa.

Story continues below advertisement

He has no illusions about the city, but says centres like this gradually make space for a new way of living. "This is a very neutral point: the gangs also feel like they belong here. They worked on the construction. Their kids and their brothers are also here taking course. So they respect the space. They come by and say 'hi' and ask if we need anything." And they're welcome, provided they are not doing anything illegal on the site – it's a determined policy that this is everyone's space, he said.

The centre is a couple of blocks from a station of the metro-cable, the cable car public transit system that Medellin pioneered to connect the hillside slums with the centre of the city, a design that has since been copied in Rio de Janeiro and Venezuela. The metro-cable connects with the metro system, and an expanding tram network, taking hours off commute times. In Comuna 13, which is today the city's most violent neighbourhood, there is a 384-metre-long escalator to whisk riders briskly to the top. All the comunas are sprinkled with parks and libraries, such as the airy glass-and-cement expanse of San Javier where elderly women received help with pension applications on a recent afternoon, and younger women gently transferred lettuce seedlings to a community garden.

"We need to physically connect people with one other – to get people to mix and get to know what's over there," said Hector Cruz. An architect with the city's metro company, he is in charge of project to take the tram system from the city centre up into another comuna. He gestured over the new tracks towards the shantytown on the opposite hill. "That area was supposed to be 'bad.' People didn't go there." That was a couple of years ago. Now there is a city-built basketball court, a goldfish pond – and a bridge.

All of this was dreamed up by Sergio Fajardo, who was elected mayor in 2003. A journalist turned mathematician turned politician, he ran as an independent, and managed to get buy-in from all corners for his schemes. Mr. Fajardo, who today is the Governor of the state in which Medellin sits, was assisted by the fact that he did not lack for cash. A state-owned company supplies the city's energy, water, telecoms and waste processing. It is almost improbably well-run and profitable, and mandated by law to allot at least 30 per cent of its profits to the city budget – $600-million this year alone. Over the past 10 years, Medellin built 120 schools and nine of the signature library parks. A third of the city budget goes to education, including the much-lauded early childhood program called "New Beginnings."

Medellin is on its second mayor since Mr. Fajardo but both have been independent and committed to continuing and expanding his vision. While the city has tackled its local problems, Colombia has been at work on the larger ones. The paramilitaries were disarmed, starting in 2003; the guerrillas were pushed back with a sustained military campaign; and today peace talks under way in Havana between the government and Marxist guerrillas feed into a mood of optimism – as does an economy growing at 5 per cent a year.

While the social urbanism project was trying to physically and emotionally connect the hillsides to the wealthy valley, a simultaneous initiative set out to give the city a new focus. Its showpiece is a gleaming brushed-steel and glass technology hub called Ruta N, which Governor-General David Johnson visited in early December on a state visit to Colombia. The name refers to the "route north," a recognition that the north of the city has traditionally been poor and shut out. Today, it is intended to be the epicentre of technology and knowledge development, the sectors for which the government wants the new Medellin to be known.

Story continues below advertisement

The city is using a combination of sweeteners, and a well-educated, service-oriented but relatively cheap work force, to lure foreign investors. Hewlett-Packard set up its continental headquarters here a few years ago, and has pulled in startups from a half-dozen other countries. Among them is the Hamilton, Ont., animation company Pipeline Studios, who opened up an office in Ruta N earlier this year.

Luis Lopez, Pipeline's co-founder, said that in Medellin they found an unparalleled enthusiasm from government, universities and colleges to provide the talent they need; they have already produced work for Disney and Nickolodeon from the city. It's the same time zone as Toronto, it's a direct flight from major North American cities, and most of their hires speak good English, yet salaries are about than half of Canadian rates for skilled staff, he added. And when clients from major U.S. cities come for meetings at the Medellin office, many remark that they feel safer there than they do back home.

"It's not fashion for us, it's a survival plan,"said German Montoya, who heads business development for the innovation district. He peppers his conversation with words such as accelerator and smart capital. In his Medellin, the biggest challenge is to convince college kids to study engineering and not psychology.

Ruta N is owned and operated by a three-way partnership between the city government, the utility company EPM and a large telecom firm; the focus is the creation of a new kind of jobs. The city is focusing on six industries including health, energy and tourism. "It wouldn't be possible to talk about moving from a manufacturing and industrial economy and building a knowledge economy if we hadn't done the social and cultural transformation of the last 12 years," he added.

Such enthusiasm is not shared in all corners. Mention Ruta N to architect and city planner Catalina Ortiz and her eyes roll behind oversized glasses. "Oh, my, are we in Switzerland?" she said sarcastically about the complex. "You go there and you see, yes, there is investment, but if you step back and look at the big picture of the city, it's so small you can't even see it."

The city cheerleaders are drunk on their own propaganda, she says. "Everyone from outside is saying we're so great, we've won more than 50 awards – there's an obsession with newness, with always talking about the city in superlatives, and it drowns out what you don't want to talk about – memory, the past, and the persistence of structural problems," she said.

Story continues below advertisement

While the public sector was investing and building in low-income areas, the private sector was building faster and fancier in rich ones, she noted. The gap between the highest income earners and the smallest has actually grown in the past 25 years, although poverty in the city has fallen. Today a fifth of citizens live below the poverty line, below the average for Colombian cities.

"There is no discussion of inequality or segregation or the role of the state as a regulator," Ms. Ortiz said. "The unemployment rate is very high. Homicide has come down dramatically but is still high." Yet the city makes accurate data about crime hard to access she said, and no one talks about what kind of dark deals the city government has to make with criminal actors to be allowed to build or operate its projects.

"There has been a dramatic transformation, you can't deny that, but it's the product of the resilience of people, of economic change, of more participatory budgeting and decentralization that happened all over the region, of a change in the political context, of the international fight against narco-trafficking – it's connected to a wide transformation, not just local government."

There are also serious questions about permanence. The current mayor, Anibal Gaviria, talks about having passed "a point of no return." Yet there is no precedent for an experiment like Medellin's, and no test other than time to show whether preschools, public transport and app design studios will be enough to stave off the influence of organized crime, the drug trade and a heavily weaponized society.

High above the city, Estella Ciro sits on her veranda in Comuna 13 and watches the changes creep up. Just below her rough clapboard house, the city is putting in a metro-cable station and up above, a greenbelt park intended to check sprawl. She came to Medellin in 1997, after the civil war arrived in her village, and family members were murdered or disappeared, and their fields were filled with land mines. When they first arrived, they lived in Santo Domingo, but had to flee late one night when her teenage son was shot by paramilitaries trying to recruit him. They left the next barrio a year later, when a gangster tried to claim her daughter.

They wound up here – and it's far from perfect. "The gang over there fought the gang over here – they killed one guy right here in front of the house," she says, gesturing to the front step while her nine-year-old grandson listens intently.

Story continues below advertisement

But they settled, and she found a tight community of older women like her who were survivors of so many incarnations of the violence. And they listen skeptically when city officials come to tell them about the next big thing they will bring to Comuna 13.

"The city is always saying it's innovative – it's not innovative for the poor and the displaced." Innovative, she said, would be piped water clean enough to drink, and proper housing. Already some of her neighbours have been told they will have to move for the metro or the park. "They come up here with their megaprojects and I think to myself, 'Here comes another displacement. Where will they put me?' The city does these things for tourists to come and admire but when will these projects mean anything for the poor?"

She pauses, then admits that the government does think about people like her, about the poor. And it's true that while the violence isn't gone, it is "in the shadows" these days, and her grandchildren have seen far less brutality than her kids did growing up. "We'll keep moving forward," she says. "And we'll see."