From high on the steep slopes of Vidigal, the panorama across Atlantic beaches and distant islands is among the most spectacular in Rio de Janeiro, Brazil. But tourists are unlikely to find it listed in most guidebooks.

Until recently, this hillside shanty town was dominated by drug gangs and widely considered off-limits among both the local and foreign middle class.

But the favela is undergoing a transformation. The police have taken control of the streets and with the gangs no longer deciding who enters their territory, rental prices have surged more than threefold in three years. Wealthy buyers are snapping up the prime plots, real estate firms are opening offices and more outsiders are moving in.

The most high-profile conflict here now is not been between rival gangs, but between two European investors who are tussling over a prime plot. Andreas Wielend, an Austrian engineer, bought a dilapidated home in 2009 and turned it into a hostel and nightclub. It is now famed for breathtaking views and holding dub and electronic music nights that attract several hundred customers to party until dawn. The change is dramatic, but not entirely for the better, says Wielend.

"When we first came here, there were 15 guys with heavy machine guns next door. It was like a war zone. There was no water or electricity. Then the police came in and the house prices went up … It was more relaxed before because you didn't constantly have real estate speculators approaching you all the time."

Wielend's neighbourhood has suddenly become one of the most fashionable in Rio. Less than 100 metres away, a hotel is under construction, reportedly financed by two of the city's wealthiest denizens.

A lawyer from São Paulo has snapped up three houses next door. Local gossip is thick with rumours that Hollywood actor Brad Pitt and Angelina Jolie have brought land nearby.

Wielend's property cost him 34,000 reals (about £10,000). Now he says he is getting offers of 1m reals to sell. The dramatic inflation of values has prompted an ownership battle between him and the German banker who sold him the land.

Last year, Wielend returned from an overseas trip to find the former owner had seized the house, changed the locks and denied that a sale had been made. Wielend has since persuaded the police that he is the rightful owner and taken legal action.

The strains are not unique to this one plot in Vidigal, he says. "Now there are many houses here where people are fighting for ownership, even among families."

Take away the paramilitary campaign against the drug gangs and what is happening is similar to the gentrification seen in cities such as New York, London, Berlin and Beijing.

Nicola Tadini, a researcher who is studying the process, says it is a mixed blessing for the community in Vidigal, many of whom – as with most of Rio's favelas – are from poor families that migrated from north-east Brazil.

"This is a long-term change. The World Cup and Olympics are pushing the process. People are investing. Locals can rent their rooms out for more than three times as much as they could three years ago. The little shops on the street are doing more business with tourist customers. Some people are selling their homes here and buying big properties back in the north-east," says Tadini.

"For now, people are happy with the way things are going because they are making more money. But the gentrification will change this community. Instead of neighbour and neighbour, you are starting to see employer and employee."

Among Rio's thousand or so favelas, Vidigal was always somewhat special thanks to its spectacular views, long history and attraction for artists. But it is seen as an indicator of what could happen to the other 39 slums that have been "pacified" by the authorities, or will be by 2014.

The average house price in Rio has increased by 165% over the past three years, says the UN. Values have risen faster in favelas where the drug gangs have been pushed out of sight. According to SecoviRio, an association of local real estate agents, property prices rose 50% in the first week after the initial three favelas were taken by police.

Changes are still at a very early stage and are different from favela to favela, as are the responses of locals to the armed police who patrol the roads and narrow alleys between their homes. While the majority of inhabitants that the Guardian spoke to were pleased about improved security and social services, several also expressed unease that they may be forcibly relocated or priced out of their homes.

Rocinha – Brazil's most populous slum with at least 70,000 inhabitants – is still far from being gentrified. But a real estate agent, who declined to give his name, says the monthly rental price for a two-bedroom home had doubled in the past year to 900 reals because more outsiders were moving in.

The authorities have ambitious plans to improve life in the favela, but their priorities have been questioned.

Rocinha now has a new library, where residents can borrow books or watch DVDs on plasma screens, a half-completed eco-park, a tennis court that opened last year and a concrete bridge to the community's sports centre that was designed by Brazil's most famous architect, the late Oscar Niemeyer.

But nothing has been done about the stinking open sewers that run through the densely packed community and overflow whenever there is heavy rain. Education and public health provision are also at dire levels. Tuberculosis and dengue fever are rampant. Many people still live in rudimentary shacks with irregular or no water supplies.

"The library and bridge are all very well, but you have to ask if this is the best use of social resources when there are still kids playing in shit and piss," says Lea Rekou, a co-ordinator of the non-governmental organisation Green My Favela, which works with the local community to replace rubbish tips with vegetable gardens.

Instead of improving the environment for the sake of gentrification or beautification before the World Cup and Olympics, she says the most needed transformation is in attitudes.

"Pacification has opened up a space. You don't need to be so wary. It's easier to relax," she says. "But my main interest is in changing the way the middle class see the favelas – that they need to be controlled and heavily policed."

Additional research by Marcela Bial