I must have been 11, maybe 12 years old. I was staring out the big glass window in the big apartment I lived in Rio de Janeiro, looking at homes made out of wood and broken pieces of plastic and, sometimes, clay bricks, impossibly perched on the hillside ahead. It was a leg of one of the city’s largest slums, Rocinha, which had draped over the mountain’s top, crossing from one neighborhood to the next.

It had been raining hard for days in Rio, as it often happens in March, and the earth that covered the hill just couldn’t hold its grip to the rock beneath it anymore. A red avalanche unfurled, dirt rolling down and swallowing the homes I had been watching. In a matter of seconds, the homes were gone, and there I was, still standing before the big glass window in my big apartment, dry and safe and warm.

Who are these people who live in this godforsaken place called Rocinha?

André Cypriano

The photographer André Cypriano went searching for the same answers some years ago, spending 30 days and nights in the slum, capturing its essence in black and white. Mr. Cypriano wound up there as a guest of Rocinha’s notorious drug lord at the time, Luciano Barbosa dos Santos, who went by the affable nickname Lulu. He had met some of Lulu’s associates while photographing some of the inmates at Ilha Grande prison, Brazil’s equivalent of Alcatraz, and they suggested Rocinha as the setting for a future project.

Mr. Cypriano — who is 47 and splits his time between Ilha Grande, an island off the southern coast of Rio, and Manhattan — said he felt safer at Rocinha than he did elsewhere. There were men armed with machine guns everywhere he looked, he recalled, and orders from the boss that he was not to be messed with.

“Everybody knew I was there to do a documentary, and I knew I could leave my equipment anywhere and no one would touch it,” he said.

Mr. Cypriano has never worked for a newspaper, magazine or photo agency. He describes his work as self-guided documentary photography because he sets the subjects and how they will be photographed. He has been exhibited around the world: one of his pictures from Rocinha — surfers posing on a rock, the slum extending behind them — hangs at the entrance of the Center for Fine Arts in Brussels, as part of a group show by Brazilian photographers called “Extremes.” Pictures from the same portfolio are also in the permanent collections of São Paulo’s Museum of Modern Art, the São Paulo Museum of Art, the Afro-Brazilian Museum in São Paulo and others. Mr. Cypriano has also published several books.

He finds inspiration in the work of Sebastião Salgado, a celebrated Brazilian photojournalist who has been known for putting a human face to economic and political oppression. There’s an underlying beauty to all of his pictures from Rocinha, even when it’s a shot of sewage flowing like a rivulet through the slum, or of hands wrapped around a crumbling wall, or of a crying woman standing in an alleyway.

“I wanted to show the dignity of the people who live there, their beauty,” Mr. Cypriano said. “You don’t need to focus on the horror to show the horror of living there.”

He said he wasn’t trying to change Rocinha through his pictures. “There’s no intentional social justice component to my work,” he said. His goal was simply to register the slum as it was. “My camera,” he said, “is the instrument that allows me to enter in these kinds of places and enjoy them for what they are.”

The rules of the Rocinha he photographed, written by the gangs that ruled drug trafficking there, are different from the rules he would find there today. The police moved in last month and seized control of the slum, part of a broad effort to tame the city’s lawless areas ahead of the 2014 World Cup and 2016 Summer Olympics.

The poverty, though, is still the same.

Fernanda Santos is an education reporter for The New York Times. She speaks four languages, and posts Twitter messages in three. Follow her: @fernandaNYT.