I had an evening to kill in Rio, and I wasn't going to spend it on Ipanema beach. Stunning though it may be, I was tired of its white poodles, snooty looks and glossy brand name superficiality. The Rio I love is boho more than bistro, samba more than bossa nova. So as the sun sank over Guanabara Bay, I headed inland to Santa Teresa, where cobbles clamber over steep hills between the city centre and the forests of Corcovado.

I was meeting a friend in Espírito Santa, a little restaurant-bar perched on a hill with sumptuous views over the city. "According to New Scientist this is officially the friendliest city on Earth," Luís told me over a zesty caipirinha. "In Rio the locals want to meet the tourists."

Not on Ipanema, I thought. But Luís was taking me on a tour somewhere altogether different – a favela party – housed in a vast warehouse in one of the breeze-block honeycombs that make up the largest slums in Latin America.

Brazilian cinema and official statistics had left me nervous. According to a Unesco report, shooting is the most common form of death for Brazilians under 25. "That's just between the gangs," Luís assured me. "Really, if you are with me you are welcome – and very safe."

I didn't feel so when we arrived. Enormous bouncers searched us for guns and ushered us past a steaming, sweaty crowd straight to a caged VIP area. An enormous, shirtless guy sidled up to me. "Where you from?" he asked. "London," I answered. His hard face burst into a child-like grin. "My best friend lives in Willesden!" He slapped me on the back.

Soon I had a new group of friends, with whom I spent the night writhing to a visceral thud on the packed dance floor. Half-drunk men were struggling to attract the attention of uninterested girls. Couples were snogging in the corner. It all looked as normal as a club night in Clerkenwell. But with a difference: in Rio, the natives are friendly.

Footprint's 'Brazil Handbook' (£14.99) is available now