JOHANNESBURG, Dec. 24 - Sending what some call an ominous signal to this nation's leaders, South Africa's sprawling shantytowns have begun to erupt, sometimes violently, in protest over the government's inability to deliver the better life that the end of apartheid seemed to herald a dozen years ago.
At a hillside shantytown in Durban called Foreman Road, riot police officers fired rubber bullets in mid-November to disperse 2,000 residents marching to the municipal mayor's office downtown. Two protesters were injured; 45 were arrested. The rest burned an effigy of the city's mayor, Obed Mlaba.
Their grievance was unadorned: since Foreman Road's 1,000 shacks sprang up nearly two decades ago, the only measurable improvements to the residents' lives amounted to a single water standpipe and four scrap-wood privies. Electricity and real toilets were a pipe dream. Promises of new homes, they said, were ephemeral.
''This is the worst area in the country,'' said one resident, a middle-aged man who identified himself only as Senior. ''We don't so much need water or electricity. We need land and housing. They need to find us land and build us new homes.''
In Pretoria that week, 500 shantytown residents looted and burned a city council member's home and car to protest limited access to government housing. Two weeks earlier, protesters burned municipal offices in Promosa after being evicted from their illegal shanties. In late September, Botleng Township residents rioted after a sewage-fouled water supply caused 600 cases of typhoid and perhaps 20 deaths.
And just Thursday, Cape Town officials warned residents of a vast shantytown near the city airport that they faced arrest if they tried to squat in an unfinished housing project nearby.
South Africa's safety and security minister said in October that 881 protests rocked slums in the preceding year; unofficial tallies say that at least 50 were violent. Statistics for previous years were not kept, but one analyst, David Hemson of the Human Sciences Research Council in Pretoria, estimated that the minister's tally was at least five times the number of any comparable previous period.
''I think it's one of the most important developments in the postliberation period,'' said Mr. Hemson, who leads a project on urban and rural development for the council. ''It shows that ordinary people are now feeling that they can only get ahead by coming out on the streets and mobilizing -- and those are the poorest people in society. That's a sea change from the position in, say, 1994, when everyone was expecting great changes from above.''
In fact, the government has made great changes. Since 1994, South Africa's government has built and largely given away 1.8 million basic houses, usually 16 feet by 20 feet, often to former shantytown dwellers. More than 10 million have gained access to clean water, and countless others have been connected to electrical lines or basic sanitation facilities.
Yet at the same time, researchers say, rising poverty has caused 2 million to lose their homes and 10 million more to have their water or power cut off because of unpaid bills. And the number of shanty dwellers has grown by as much as 50 percent, to 12.5 million people -- more than one in four South Africans, many living in a level of squalor that would render most observers from the developed world speechless.
For South African blacks, the current plight is uncomfortably close to the one they endured under apartheid. Black shantytowns first rose under white rule, the result of policies intended to keep nonwhites impoverished and powerless. During apartheid, from the 1940's to the 1980's, officials uprooted and moved millions of blacks, consigning many to transit camps that became permanent shantytowns, sending others to black townships that quickly attracted masses of squatters.
Privation led millions more blacks to migrate to the cities, setting up vast squatter camps on the outskirts of Cape Town, Johannesburg, Durban and other cities.
From its first days, South Africa's black government pledged to address the misery of shanty life. That the problem has instead worsened, social scientists, urban planners and many politicians say, is partly the result of fiscal policies that have focused on nurturing the first-world economy which, under apartheid, made this Africa's wealthiest and most advanced nation.
The government's low-deficit, low-inflation strategy was built on the premise that a stable economy would attract investment, and that the wealth would spread to the poor. But while the first-world economy has boomed, it has failed to lift the vast underclass out of its misery.
Unemployment, estimated at 26 percent in 1994, has soared to roughly 40 percent many analysts say; the government, which does not count those who have stopped looking for work, says joblessness is lower. Big industries like mining and textiles have laid off manual laborers, and expanding businesses like banking and retailing have failed to pick up the slack. Many of the jobless have moved to the slums.
So far, the shantytown protests have focused exclusively on local officials who bear the brunt of slum dwellers' rage. But while almost all those officials belong to the governing African National Congress, and execute the party's social and economic policies, ''the poor haven't made the connection as yet,'' said Adam Habib, another scholar at the Human Sciences Research Institute who recently completed a study of South Africa's social movements.
On the contrary, national support for President Thabo Mbeki's governing coalition appears greater than ever before. Still, Mr. Mbeki has been visiting shantytowns and townships, promising to increase social spending and demanding that his ministers improve services to the poor.
For now, nearly half the 284 municipal districts, charged with providing local services, cannot, the national ministry for local government says. Their problems vary from shrunken tax bases to inconsistent allotments of national money to AIDS, which has depleted the ranks of skilled local managers.
Incompetence and greed are rife. In Ehlanzeni, a district of nearly a million people in Mpumalanga Province, 3 out of 4 residents have no trash collection, 6 out of 10 have no sanitation and 1 in 3 lack water -- and the city manager makes more than Mr. Mbeki's $180,000 annual salary.
The frustrations of slum dwellers began to boil over in mid-2004, when residents in a shantytown near Harrismith, about 160 miles southeast of Johannesburg, rioted and blocked a major freeway to protest their living conditions. The police fatally shot a 17-year-old protester. Since then, demonstrations have spread to virtually every corner of the nation.
In Durban, the city is erecting some 16,000 starter houses a year, but the shanty population, now about 750,000, continues to grow by more than 10 percent annually.
The city's 180,000 shanties, crammed into every conceivable open space, are a remarkable sight. Both free-standing and sharing common walls, they spill down hillsides between middle-class subdivisions, perch beside freeway exits and crowd next to foul landfills. They are built of scrap wood and metal and corrugated panels and plastic tarpaulin roofs weighed down with concrete chunks. Their insides are often coated with sheets of uncut milk and juice cartons, sold as wallpaper at curbside markets, to keep both the wind and prying eyes from exploiting the chinks in their shoddily built walls.
The 1,000 or so hillside shanties at Foreman Road are typical. A standpipe at the top provides water, carried by bucket to each shack for bathing and dishwashing. At the bottom, perhaps 400 feet down a ravine, are four hand-dug, scrap-wood privies -- each one, on this day, inexplicably padlocked shut. Residents say they seldom trek down to the privies, relieving themselves instead in plastic bags and buckets that can be periodically emptied or thrown away.
The one-room shacks provide the rudest sort of shelter. A bed typically takes up half the space; a table holds cookware; clothes go in a small chest. There is no electricity, and so no television; entertainment comes from battery-powered radios. Residents use kerosene stoves and candles for cooking and heat, with predictable results. A year ago, a wind-whipped fire destroyed 288 shacks here. A fire at a Cape Town shantytown early this month left 4,000 people homeless.
A few shacks are painted in riotous colors or decorated with placards hawking milk or tobacco, or shingled with signs ripped from light poles, once posted to warn that electricity thieves had left live power lines dangling in the street.
The residents say Mayor Mlaba promised during his last election campaign to erect new homes on the slum site and on vacant land opposite their hillside. Instead, however, the city proposed to move the slum residents to rural land far off Durban's outskirts -- and far from the gardening, housecleaning and other menial jobs they have found during Foreman Road's 16-odd years of existence.
Lacking cars, taxi fare or even bicycles to commute to work, the residents marched in protest on Nov. 14, defying the city's refusal to issue a permit. The demonstration quickly turned violent.
Afterward, in an interview that he cut short, a clearly nettled Mayor Mlaba argued that the protest had been the work of agitators bent on embarrassing him before local elections next year.
''Of course it's political,'' he said. ''All of a sudden, they've got leaders. There weren't any leaders yesterday. Are they going to be there in 2006 or 2007, after the elections?''
Also suspecting agitators, South Africa's government reacted initially to the shantytown protests by ordering its intelligence service to determine whether outsiders -- a ''third force'' in the parlance of this nation's liberation struggles -- sought to undermine the government.
Residents here scoff at that. ''The third force,'' said the man called Senior, ''is the conditions we are living in.''
In a shack roughly 7 feet by 8 feet, a third of the way down Foreman Road's ravine, Zamile Msane, 32, lives with her 58-year-old mother and three children, ages 12, 15 and 17. Ms. Msane has no job. A sister gives her family secondhand clothes, and neighbors donate cornmeal for food. In seven years, she has fled three wildfires, in 1998, 2000 and 2004, losing everything each time.
Yet Ms. Msane, who came here from the Eastern Cape eight years ago, said she would not return to the farm where she once lived, because there was nothing to eat.
Ms. Msane said she joined the Nov. 14 march for one reason.
''Better conditions,'' she said. ''It's not good here, because these are not proper houses. There's mud outside. We're always living in fear of fires. Winter is too cold; summer is too warm. Life is so difficult.''
Photos: Zamile Msane, 32, who is unemployed, washes dishes outside the shack she shares with her mother and three children at Foreman Road. Over seven years, her home has burned down three times.; Cebisa Nkenkwenkona, 20, at her shanty in Foreman Road. Residents have clashed with the police as they have demanded better government services for the slum, which lacks electricity and real toilets.; Children roam the blighted landscape of Foreman Road, a teeming hillside slum of 1,000 tiny hovels typical of South Africa's shantytowns. (Photographs by Vanessa Vick for The New York Times)