In Bolivia, breaking out of prison is hard. Sneaking in is pretty easy, especially if it’s San Pedro Prison, the most bizarre correctional facility in the world.

In this gaspingly high prison, outside Bolivia’s capital La Paz and 11,500 feet up in the Andes, more than 2,400 male prisoners work as pastors, food vendors, tour guides, prostitutes, barbers, carpenters, shoe-shiners and cocaine manufacturers. One even ran for vice-president of Bolivia from inside the prison’s walls. The 50 or so guards monitor the inmates from outside the prison; their only job is to see that no one escapes. Inside, however, the prisoners run the joint.

In 2009, I was a young backpacker in Bolivia looking for adventure. I had first learned of the prison way back in 2005 from a Lonely Planet guidebook. One former British prisoner there, Thomas McFadden, had achieved no small amount of notoriety by giving tours of the place to wide-eyed backpackers. He was doing time for drug smuggling, and he didn’t think prison should limit his business opportunities.

One night, McFadden bribed some guards to escort him out for a night of debauchery at a dance club in the city’s capital. One Israeli backpacker he met became fascinated by his situation and visited him the next day. Once again, McFadden bribed the guards to allow her and her friends inside San Pedro. The story of their visit quickly spread among the ‘Gringo Trail’ and McFadden lucked into a business as the unofficial tour guide. One of his customers, Rusty Young, went on to co-write McFadden’s bestselling memoir, Marching Powder: A True Story of Friendship, Cocaine, and South America’s Strangest Jail, which told the story of his international cocaine smuggling career, a career for which he served time in San Pedro from 1996 to 2000.

After that, backpackers on the South American ‘Gringo Trail’ began touring and partying in San Pedro. By February 2009 a YouTube video, which included cocaine, marijuana and a young boy fast asleep in bed, went viral, posted by a group of tourists. This coincided with the announcement that Brad Pitt’s film company would adapt McFadden’s story with Don Cheadle as the lead. The subsequent media attention led prison authorities to officially shut down the tours.

That’s how, in July 2009, after reading Marching Powder, I found myself in Bolivia’s capital. San Pedro Prison sounded like everything I wanted to experience when I started backpacking as a teenager. It offered excitement and danger, but not too much. It was the perfect blend of exotic adventure and Lonely Planet guidebook assurances of safety.

I decided to see if there were still unsanctioned tours. A shoeshine boy told me I should just wait in line like the other visitors. Despite his lack of awareness that tourists like me were prohibited from entering, this false encouragement gave me the short-lived confidence to enter the queue. I realized, however, as I stood in line with the friends and families of inmates, looking gringo and adolescent, that I was putting myself into territory far outside the stuff covered in my trusty guidebook.

At the first of three checkpoints, a guard asked who I was visiting. I told the guard, “I am here to visit a friend of a friend, José.” He told me to enter while smirking, knowing full well my intentions. I surrendered my passport at the third checkpoint to another guard who scribbled a sharpie tattoo on my forearm that I would show again when I wanted to leave.

I entered the metal gates to an open courtyard full of inmates eagerly waiting for their own visitors. A wave of shock took over as I realized I was alone in a confined space with around 2,400 of the country’s most notorious criminals, and the tours supposedly there to protect me no longer existed. My confused expression and obvious gringo-ness drew the attention of some inmates. One of them fetched Manuel, nicknamed Barba (Spanish for beard), who was, of course, clean shaven. Barba was awaiting trial for cocaine trafficking.

After paying Barba his requested fee—about $30 — by entering a urine and feces covered bathroom stall and slipping the cash underneath to the next stall, he took me to lunch at one of the many restaurants in the prison. The barbeque meat and sides served by a stocky female cook tasted better than food I was accustomed to eating outside of prison in Bolivia. I suspect that since lunch was my treat, Barba took me to his favorite restaurant.

We went on a walk while digesting our lunch through a labyrinth of hallways and stairs to reach the tiny, shared room where he slept next to four other roommates. Barba offered me a line of cocaine as we sat on his bunk bed covered by posters of musicians and half-naked women. Part of the appeal of the tours for many tourists had been the chance to snort what was rumored to be the purest cocaine in Bolivia, and do it inside of a prison.

At one point Barba pulled out a shank and told me about the time he stabbed and killed another inmate in self-defense over a drug dispute. He told me this while walking beside the pool McFadden described in Marching Powder where a child molester was beaten to death by a mob just hours after he entered the prison.

When I first met Barba, one of the first places he took me to was the church where I met a pastor who cheerfully described his mission to help the children who were running circles around us as we spoke. Barba and I soon exited through the window onto the roof for a bird’s eye view explanation of the prison’s history, politics, economics and facilities as we soaked in the unfiltered sun at almost 12,000 feet amongst the snowcapped Andes surrounding the city. I looked down and I saw smoke rising from small restaurants, children playing with toy cars, shoes being shined, clothes hanging from lines, and some cement and tin built homes.

Barba explained that prison cells are replaced with a bustling housing and rental market with “homes” that range in quality from 12 by 12 foot cement shacks with dismal facilities to large, luxurious apartments with Internet and hot tubs.

However, if an inmate cannot find a job, he should expect to sleep outside with other homeless inmates. Some of the prisoners who do make ends meet also invite their wives and children to live with them as they otherwise have no way to support themselves. If a prisoner does have disposable income, he might just purchase what is rumored to be the purest cocaine in Bolivia, produced directly by inmates inside the prison.

The prisoners organize themselves through democratically elected representatives of the eight separate prison sections. Some have political aspirations even beyond the prison’s walls.

That’s how I found myself sitting in front of vice-presidential candidate Leopoldo Fernández on the concrete steps outside of his home inside San Pedro. Barba had insisted I talk to him and I pretended to be a journalist instead of the teenage backpacker with a travel blog I really was.

Fernández was governor of the northern department of Pando from 2006 to 2008 before he was arrested for acts against the state of emergency imposed by President Evo Morales. His imprisonment was for allegedly organizing events that led to the murder of 19 teachers and farmers during a pro-government protest on Sept. 11, 2008, and for his role in seeking autonomy for a region of Bolivia through referendums deemed illegal by the Morales government.

The former governor handed me a 20-page pamphlet and protested his innocence, spun plenty of conspiracies involving President Morales, and complained of the lack of a trial, all with a politician’s strong tone. At the time, I doubted his identity, but later I verified his name and photo online.

He ranted about the injustice of being imprisoned here by the Morales government, and months after my visit with him, he ran for Vice President from prison, and managed to come in second with 26 percent of the vote.

In addition to running for office in San Pedro, you can also make cocaine and that, along with the locked-up politician still running for office, women and children living inside, and the fact that there was a “professional” tour guide all illustrated the strangeness of San Pedro Prison.

San Pedro is a model of brutal self-governance, one that exists throughout Latin America’s prison systems. However, Adriana, a 27-year old La Paz native who volunteered in San Pedro Prison in 2001 told me that San Pedro does not fulfill the fundamental purpose of prisons. The prisoners “can choose what they eat, dress or do, as long as they don’t get out. This might have been a positive feature if it wasn’t for the influence of corrupt policemen, the failures in the judicial system and the absence of control over what comes in and out of the prison.”

One Bolivian journalist, Lauren Leticia Rivero Aracena, added “that control of the prisons by prisoners in collaboration with police and authorities are responsible for the prison administration permitting alcohol, drugs, knives and fire weapons, women and parties, and a vast range of criminal network organizations that are managed from the inside of jail, where an alarming 80 percent of inmates have no final judgment.” She added that Bolivian “prisons are a true reflection of society” and “San Pedro does not fulfill its social function to re-incorporate the individuals back into society.”

The way San Pedro Prison functions is a necessity as a result, Bolivian journalist Aldo Medinaceli explained to me. However, he believes the “real necessity is to change this way of living.” In the meantime, their self-rule is “similar to the old favelas in Brazil” with plenty of unwritten rules replaced with a complex set of “urban codes” to help organize people who want to “live well, be happy, learn, or go free, as we are outside the walls.”

Just because the prisoners have an unparalleled degree of freedom and control over their lives does not mean the inmates aren’t trying to escape. Fifty or more guards monitor the inmates from the outside to prevent escapees; it is their only job. Still, four prisoners escaped in September 2014, using blankets and sheets to scale the prison walls. The irony is not lost as rumors say the guards left their post because of cold weather. This all occurred after the first day of an annual weeklong celebration called “la semana de las personas privadas de libertad” (“Week of Detainees”). Interpol and national authorities are still searching for three of escapees.

For the entire duration of the hours I spent inside San Pedro I noticed my abdominal muscles remained perpetually clenched. I imagine that a prisoner completely on his own would never lose that feeling. While the ability to move about San Pedro freely is remarkable, the lack of protection by guards and absence of locked cells makes it impossible for a prisoner to ever let his guard down.

When I flashed my sharpied arm to a guard on the other side of the gate and left San Pedro before sunset I knew that the danger inside for Barba and others like him became more real. While I no longer needed to pay close attention to my surroundings while I sat drinking a beer at my hostel, the average prisoner like Barba would continue to fend for himself. Adriana explained to me that in 2001 she “remember[s] having seen prisoners in blood, drunk or in the middle of a fight.”

I can appreciate the perspective that my experience is akin to visiting a human zoo. “I personally don’t like it,” Adriana told me, “It feeds the perversity of tourists and devalues the role of the prison by turning it into a circus.”

In 2013 a 12-year old girl living in San Pedro reported her pregnancy to the authorities: a result of rape spanning four years by her father, uncle, and godfather according to Prison Director, Ramiro Llanos. Bolivians were outraged and pressured the government to reform the country’s prison system. That summer, authorities announced the closure of San Pedro in response to the national anger and citizen protests. But San Pedro’s prisoners protested the decision and denied the allegations of rape.

Today, San Pedro is still open because, as Adriana told me, “there’s nowhere to immediately relocate the prisoners and these projects tend to take a long time.” Its continued existence still sparks national debates on corruption, a broken correctional system and tourism in Bolivia.

Pitt’s production company have dragged their feet in developing Young’s book, but in June 2014, Fox recently acquired the script and said it would now make the movie with 12 Years A Slave star Chiwetel Ejiofor as McFadden.

With the increased media attention, might the authorities finally close the prison after nearly 120 years in operation and convert it into a museum? Journalist Aracena, argues that the closure isn’t likely because investment in new facilities “would not generate votes” and “no government wants to deal with San Pedro, without other economic interests and social benefits for the current prison administrators.”

However, Adriana referenced a proposal “to transform the current prison into a cultural center.” The U.S. government has successfully done just that with the Eastern State Penitentiary in Philadelphia and Alcatraz in San Francisco, with the occasional ex-prisoner leading tours of the defunct prisons. Bolivia might finally address the country’s overcrowded prisons and corrupt and ineffective judicial system that leaves a perpetual buildup of court cases, like the cases of Barba and Leopoldo Fernández?.