A BLUE metal fence runs through Zango, a commuter town along the main road out of Luanda, Angola's capital. On one side stand new apartment buildings for civil servants, with luxury kitchens and a sprinkler system embedded in the lush lawn. On the other sit the farmers who used to till the land until they were evicted. A mother scratches the dry ground outside her hut, begging for a few mouthfuls of water. “We used to have corn and potatoes and cassava before the government took our fields,” she says.

Since ending a 27-year civil war in 2002, Angola has become one of sub-Saharan Africa's richest countries. Angolan mines are the fifth-largest source of diamonds worldwide. Its oil wells already produce 1.9m barrels a day; on present trends, it could overtake Nigeria to become Africa's largest producer. It has huge agricultural potential. Roads and railways that were destroyed during the fighting have been rebuilt. New schools and hospitals have sprung up.

But Angola is also one of the world's most unequal countries. (Its Gini coefficient—a measure of income distribution in which zero indicates perfect equality—is 0.55). Most of the benefits of the resource boom have gone to a fairly small elite that lives in an African version of St Tropez, with ritzy beach clubs inside walled enclaves. A crop of skyscrapers encircles a harbour decorated with sleek motorboats and a Ferretti yacht costing $5.5m.

The musseques, as the self-built settlements of the poor are called in Angola, used to start right behind Luanda's white sandy beaches. Now they have been pushed inland, away from the most desirable spots. Land seizures have become an explosive political issue, as the capital's hinterland fills up with the displaced. These people are given tin sheets to build shanty towns—but no compensation. Only 9% of Luanda's population of 5m has running water, a lower share than during the civil war. Across Angola, half the population of 18m has virtually no access to health care. The country has one of the world's highest rates of infant mortality, and the only known cases of urban polio.

The government says all the right things about the need to improve public services. It promises “water for all” and pledges to build “one million houses” (dubbed by critics “one million dollar houses”, since most of those it does build are unaffordable to all but the rich).

The government's budget is about $40 billion, bigger than that of some European countries. But aid agencies are still the best hope for ordinary Angolans. In Kilamba Kiaxi, a suburb of Luanda, 1m people got their first taste of running water last year when Unicef set up a few dozen taps. Local officials had told residents they lacked the funds to pump water along existing pipes. In one case Unicef paid a $200,000 fee to the state water company to turn on a tap.

Part of what ails Angola is a lack of skilled civil servants, as well as too much red tape. After officials recently bought 3,000 new buses they could find only 1,500 drivers. The bureaucracy is grossly inefficient. When the World Bank offered a loan to Angola, it took two years for the paperwork to come through. In particular, the private sector suffers. It takes 56 laborious steps to set up a business.

Critics complain that the government, a prickly but proud bunch of mainly former guerrillas, pays vast sums for white elephants intended to make it look good. It spent more than $1 billion on four stadiums for the Africa Cup of Nations, a football tournament. It also built an imposing stock exchange, though there is no bourse.

At the trough

Big projects offer the richest pickings too. In the ranking of perceptions of corruption published by Transparency International, a Berlin-based lobby, Angola has fallen from 22nd from the bottom to 10th in the past two years. Rafael Marques, a local campaigner, takes visitors on a “corruption tour” of Luanda, pointing out which presidential crony or cousin owns this building or that bank.

The government's defenders say that at least not all the money is being stolen outright. But as well as contract padding, Angolans have lost out as officials seize state assets through rigged privatisations or rip off the public treasury in bail-outs of private companies. At almost every turn, someone connected to the state is seeking a pay-off. A farmer gets $10 for a box of 100 avocados. By the time they reach Luanda the price has risen to $5 each, thanks to cuts paid to officials, soldiers and policemen along the way. A doctor close to the top of the ruling party has a concession for rubbish-collection in Luanda: he has kept out competitors but fails to provide any service in poor districts. Streets are filled with rotting fruit, faeces and other disease-spreading detritus.

The logic behind the kleptocratic system is complex. Having won the long civil war, members of the ruling People's Movement for the Liberation of Angola (MPLA) feel they deserve a share of the spoils. José Eduardo dos Santos, the president for the past 31 years, has seemed happy to oblige them to ensure their loyalty. His own family has stakes in several companies. Though publicly in favour of private enterprise and foreign competition, Mr dos Santos is a former Marxist, trained in the Soviet Union, and remains something of a protectionist. He appears to see the many barriers to trade thrown up by his rent-seeking minions as a means of preventing multinationals from taking over. He has a finely honed instinct for preserving his power and a relatively low appetite for outright brutality—Vladimir Putin rather than Joseph Stalin.

Already sub-Saharan Africa's second-longest-serving leader, Mr dos Santos has changed the constitution so that he can stay in office until 2022 without having to face a direct election again. The changes eliminate elections for the presidency; instead, the leader of the largest group in parliament automatically gets the job. But power is still concentrated in the president's office. It controls all budgets and appoints judges, prosecutors, generals, state governors and election commissioners.

Full steam ahead

Yet centralised politics and a grasping state seem unlikely to dim Angola's economic future. On February 24th the government is due to announce new offshore oil concessions in “pre-salt” deposits that are geologically similar to those across the Atlantic in Brazil. They could turn Angola into one of the world's leading oil-producing nations.

But without political change, the poor majority will benefit little. Not surprisingly, public anger has been building. Protests flared last month in Cazenga, a district of Luanda that has traditionally been an MPLA stronghold. Separatists in the province of Cabinda, who made headlines by shooting at the Togolese team during the African cup, are increasingly active. Soldiers complain that generals steal so much of the army's budget that they don't get boots any more. Oddly, even one of the president's daughters has lashed out—at oligarchs who she said have created “the biggest number of tentacles possible to sabotage or destroy competing businesses”. Nervous Western oil companies give millions to local schools and hospitals to avoid being tarred with the same brush.

An uprising is unlikely, since memories of the civil war that killed 1.5m people are still fresh. But parliamentary polls in 2012, though probably rigged, will see more competition than last time, when the MPLA won over 80% of the vote. The president is already campaigning, having made his first state-of-the-nation address last October. Barring a vast drop in the oil price, which would threaten the patronage system, he will almost certainly win. Change may have to await the emergence of a post-war generation of leaders, free of old fears and prepared to challenge the man they call o pai grande, the great father.