Rio's most wanted man, who allegedly presided over £35m cocaine racket, caught in boot of Toyota Corolla while fleeing

Like many residents of Rio's largest favela, he was the son of economic migrants from Brazil's impoverished north-east who came to the city in search of a better life.

He rose to become the "dono do morro" or "king of the hill"; and if police are to be believed, a powerful and feared drug lord with a penchant for Armani suits, heavy artillery and ultra-violence.

But this week the four-year reign of Antônio Francisco Bonfim Lopes — Rio's most wanted man and the "boss" of the city's Rocinha shantytown — came to a bizarre end after the 35-year-old was arrested while attempting to flee the slum in the boot of a Toyota Corolla.

Inside the car was Lopes's four-strong entourage who told police they were diplomats from the Democratic Republic of Congo and attempted, unsuccessfully, to invoke diplomatic immunity before offering a hefty bribe.

"Why is the car boot shaking?" a suspicious arresting officer reportedly inquired, before Lopes was found curled up inside.

Better known by his nom de guerre 'Nem', Lopes was born to migrants from the north-eastern state of Paraiba. According to reports in the crime tabloid O Povo, he once worked as a cleaner in an Ipanema beauty parlour, eventually being promoted to office boy.

That changed in 2004. Fed up with the daily grind, Lopes allegedly accepted an invitation to become a security guard for Rocinha's then boss, Erismar Rodrigues Moreira. Moreira, or Bem-Ti-Vi, was known for the gold-plated arsenal of machine guns and rifles he used to control Rocinha, a sprawling hillside slum in southern Rio, flanked by some of the most exclusive neighbourhoods in town.

When Moreira died in a hail of police bullets in 2005 Lopes allegedly saw his opportunity to move up the food chain. He hatched a plan to eliminate Moreira's immediate successor, a gangster known as Soul, and in 2007 took full control of the slum.

As the alleged boss of Rocinha, Lopes presided over one of the most lucrative cocaine rackets in town. According to police the region was controlled by an army of around 200 rifle-toting soldiers who were responsible for selling some 200kg of Bolivian cocaine a month, bringing in an annual fortune of around R$100m (£35m).

Lopes's transformation from cleaner to drug lord brought him riches unimaginable to most of Rocinha's residents, many of them porters, cleaners or construction workers who scrape a living working for the city's middle and upper classes.

He ran his business from a luxurious three-storey mansion in Laboriaux, a neighbourhood at the crest of Rocinha, and earned a reputation for his ecstasy-fuelled raves at which a number of Brazilian celebrities put in appearances.

In 2010 a group of local reporters gained access to Lopes's home during a police raid. Inside they found garish sofas, miniature palm trees, state-of-the-art televisions, Armani suits, and a swimming pool with a view over Rio's dramatic beachside scenery. The bar was stocked with 4.5lt bottles of Johnnie Walker Black Label whiskey and champagne.

But Lopes's growing media profile came at a price. His capture became a question of honour for authorities and a R$5,000 bounty was put on his head. Virtually confined to his hilltop fiefdom, Lopes knew it was only a matter of time before he was arrested or killed. Keen to stay under the radar, Lopes took action. He began working out and using steroids to alter his appearance; he reputedly underwent plastic surgery and dyed his hair. Enemies or informants, police claim, were eliminated, their bullet-riddled corpses burned in improvised crematoriums hidden in the rainforest around the slum.

In 2010 Lopes even attempted to fake his own death, paying a local doctor R$150 to sign a bogus death certificate claiming the trafficker had died of kidney failure.

On Wednesday night Lopes's final bid to elude authorities failed in spectacular fashion. With police preparing a massive operation to permanently occupy Rocinha, he was hauled out of the boot of a Toyota while trying to flee.

Gabriela Moreira, a reporter from Rio's O Dia newspaper, was one of the few journalists to gain access to Lopes, squashed up against him in a lift as he was dragged into the federal police HQ for questioning.

"It didn't scare me at all," Moreira recalled of her brief encounter with the elusive Nem. "All I could think was: here is the biggest criminal in Rio who is capable of killing and whatever else and he just doesn't seem like it. Where is that myth that has been constructed? I just thought, man, he seems like a normal guy."