The 45-storey skyscraper that the Venezuelan entrepreneur David Brillembourg began building in the booming financial centre of Caracas of the early 1990s never did become the emblem of abundance its late owner intended it to be. A banking crisis truncated his dream.

But 20 years later, the incomplete Torre Confinanzas, or Torre de David (Tower of David) as it most widely known, with its staircases that lead nowhere and ramps that spiral into infinity is experiencing something of a renaissance – not as a home for a prosperous bank, but 2,500 squatters.

The squat, thought to be the tallest anywhere in the world, is an eyesore for President Hugo Chávez and his supporters, a reminder that basic housing for millions is a problem in their oil-rich country: 51% of the population lives in precarious shantytowns with no access to basic services. In the capital city alone, there is a shortage of almost 400,000 houses. With little access to loans, and a permissive attitude from the Chavista government towards land invasions and illegal takeovers, squatting has become one of the few housing options people have.

The takeover of Torre de David began four years ago when 300 people forced their way into the derelict building. "The night we came in, I was scared, but I was also excited to finally have my own home," says Jhonny Jimenez, 31, a member of the founding group and now one of the tower's main co-ordinators. "We organised people according to their needs: the elderly who can't go up flights of stairs would go in the lower floors and large families would get more space."

Torre de David still lacks basic services, but the building functions well. Each of the 22 inhabited floors has co-ordinators, like Jimenez, who oversee the general functioning of their assigned area.

The management of the building is divided into three departments: health services, recreation and security. Space is granted free, but people pay a monthly fee of 150 Bolívar fuerte (£13) for improvements such as a recreation room for children and an evangelical church being built on the ground floor.

"It's a city within a city, with corner shops on every other floor, cybercafes and apartments that double as hair salons and other types of informal businesses," says Leo Alvarez, a lawyer who has documented these informal settlements. "It functions, and quite well, with no authority other than their pastor."

Alexander Daza, or el Niño, is the evangelical pastor and the leader of the community, a label he resists. "I've done all sorts of work here from carrying sacks of cement to changing lightbulbs. I gained people's respect through example, like Jesus, like Che [Guevara]." he says. "We have legalised everything. Nobody has tried to evict us. On the contrary, [government officials] are in favour of us."

The future of Torre de David remains a contentious issue. Critics think it would be more profitable to restore the building to its intended use. "With the money from office spaces like that you could pay for houses that did have proper services for all the people that live there and more," says José Alejandro Santana, a professor of architecture at Venezuela's Central University.

Mike Davis, urban theorist and author of Planet of Slums, thinks Torre de David "is testimony to the acute housing shortage in Caracas, a problem, like crime, that has vexed the Chávez government. Despite official rhetoric, the Bolivarianist regime has undertaken no serious redistribution of wealth in the cities and oil revenues pay for too many other programmes and subsidies to leave room for new housing construction."

He says the building has great potential: "What interests me more about Torre de David is its emergent ecology with small businesses, jerry-rigged services; it makes it an obvious candidate for a 'green skyscraper' experiment."

Torre de David is far from the perfect home. No sewage system is in place, lorry-delivered water is rationed, whole sections of the building are in the dark and the absence of lifts forces people to walk up hundreds of stairs.

In some units, the only thing separating its owners from a 30-metre (98ft) fall is caution. And yet, to most of the inhabitants, conditions are better than what they previously had.

"The shanties don't have services either and they're far from everything," says Gregorio Laya, a 36 cook who recently moved in. "Here I step out the door and there is a bus stop that takes me to my job in five minutes. This place is a blessing."