“When my family moved to Medellín, all I could see was drugs, violence and prostitution,” says Zuleima Pérez, 21. “My best hope was to get married, have kids and find some basic job. This school allowed me to think bigger.”

Around us, in the graffitied courtyard of a high school in Aranjuez – formerly the most notorious of Medellín’s barrios – kids of all ages mill about. Bass spills from the adjoining classrooms. In one room, an exasperated teacher is leading infants in a warm-up; in another, teens are being marshalled in breakdancing exercises with the intensity of a military drill. Upstairs, a group of twentysomethings contort to a remix of Notorious BIG’s Kick in the Door.

Every night, this school is taken over by one of Colombia’s best known hip-hop groups, Crew Peligrosos. They offer underprivileged kids the chance to learn the four elements of hip-hop – breakdance, DJing, rap and graffiti – as an alternative to a life of gang affiliation.

All Crew Peligrosos members contribute 10% of their salaries towards running costs at 4 Elementos Skuela

Though Pérez is the only female member of Crew Peligrosos, roughly 40% of the 600 students at the school, called 4 Elementos Skuela, are girls.

“The Skuela teaches us to trust and believe in ourselves,” says Pérez. “Not only does it increase our strength and our skills, it also puts us in a new social position where we are capable of doing everything we set out to. It creates a new system in which women are secure in themselves and believe they can stand out in any activity.”

After moving to Medellín 10 years ago from nearby San Carlos, Pérez came across one of the crew’s public performances. “I was blown away by the show,” she recalls. “I saw one girl performing and thought, that could be me.”

‘Previously these kids would have been out there destroying themselves and the neighbourhood, says Crew Peligrosos founder Henry Arteaga

Since the 80s the city has undergone a meteoric transformation, branded “the Medellín Miracle”. Once notorious as the world’s murder capital – in 1991 there were 6,349 killings, a homicide rate of 380 per 100,000 citizens – it now attracts international tourism and last year won the prestigious Lee Kuan Yew world city prize. Part of the credit goes to former mayor Sergio Fajardo who, from 2004-2007, implemented a bottom-up regeneration plan aimed at the city’s poorest neighbourhoods.

The unsung heroes, however, were a nascent generation of hip-hop collectives who didn’t just denounce drugs and violence, but started social-development initiatives: street-art projects, arts festivals and educational programmes for children. As well as 4 Elementos, Medellín now boasts hip-hop schools in San Javier (Casa Kolacho) and Guayabal (La Gran Colombia), both of which teach around 400 kids.

“The hip-hop culture in Medellín has been a key piece in the construction of the city’s collective imagination,” says Lina Botero, Medellín’s secretary of culture. “Many young people in the city’s most troubled neighbourhoods found in music, dance or graffiti a way of living outside the circles of violence and poverty to which they were destined.”

Young people learn about graffiti art on the streets of Medellín

Though hard to quantify, it is clear that the schools filled a huge new appetite for positive change. Soon after starting life in one memeber’s house, 4 Elementos was overflowing with eager students. The local high school offered up a classroom, and when that too was filled to capacity, Crew Peligrosos were handed the keys to the entire building on a nightly basis. To date, more than 4,000 young people have attended, some coming every day.

All 22 members of Crew Peligrosos teach at the school and contribute 10% of their salaries towards running costs. The classes are free, there is no age limit and every student has the chance to represent Crew Peligrosos in public if they develop their skills to a sufficient level.

“From 5-10pm every day we have the local kids here creating, creating, creating – trying to improve themselves,” says founder Henry Arteaga, known as JKE. “Previously they would have been out there destroying themselves and the neighbourhood. Hip-hop gave them an alternative.”

Crew Peligrosos perform in Aranjuez

Arteaga was inspired to found Crew Peligrosos in 1999 after seeing the film Beat Street, about the birth of hip-hop culture in the Bronx. “Those tourists who come here to do the Pablo Escobar tours have no idea what it was like back then,” he says. As they trained in the streets of Aranjuez, the group found many of the kids were keen to join in, and quickly saw the potential. “Our goal was to develop the person, rather than just the artist,” says Arteaga.

The murder rate in Aranjuez has fallen 80% in the time since 4 Elementos began. Although a number of factors are involved, the school now organises presentations, countrywide tours and an annual festival where the students can share their new skills with a wider audience. Assisted by the Miami-based ABC Foundation, Crew Peligrosos are opening new branches in the barrios of Palmitas, Manrique, San Cristóbal and El Retiro.

It is a model that has found success in other countries. In Venezuela, Hip Hop Revolución runs 31 schools aimed at turning teenagers into community leaders. In South Africa, the rapper Emile Jansen has led Heal the Hood, a school aiming to give the youth of Cape Town’s notorious Cape Flats district an alternative to gang life, since 2005.

But progress is not the same as panacea. Arteaga bemoans the widespread use of the “Medellín Miracle” narrative to whitewash the city’s ongoing gang troubles. He recounts a turf war that broke out in the barrio two years ago, which resulted in 27 killings in one day yet went widely unreported.

Nevertheless, Crew Peligrosos remain undaunted in their mission. Asked whether she’s craving hip-hop stardom, Pérez says: “No – I want to teach. I want to help this school become international, in order to give kids all over the world the same opportunity I’ve had.”

Follow Guardian Cities on Twitter, Facebook and Instagram to join the discussion, and explore our archive here