When independence came to this African nation five years ago, the capital was known as Salisbury, after a British prime minister. About 300 pupils, all of them white, were then attending the Lord Malvern secondary school, located in a comfortable, tree-lined suburb here.

Today the capital is called by its original African name, Harare. The Malvern school has kept its name, but it has been Africanized. About 1,300 pupils now attend the school; all but six of them are black.

"We've always been a little bit ahead -- whatever happened in this country has happened here first," said Alec Dry, the school's headmaster since 1979.

The social upheaval at Malvern mirrors a profound change that has transformed this former white-ruled, British colony since Prime Minister Robert Mugabe's black-majority government took power five years ago.

Many whites have withdrawn to private institutions or fled abroad, while blacks have placed a flood of demands on the country's fragile social services.

The government has responded by building thousands of low-income houses and hundreds of new medical clinics. It has instituted virtually free public health care and has revitalized peasant farming with land and credit. A senior civil service that once was 100 percent white is now nearly 75 percent black.

But nowhere has change been more visible or dramatic than in Zimbabwe's schools, where the government has sought to accomplish more in five years than most African states have attempted in 25.

Universal primary education has almost been achieved. The ranks of students and teachers have tripled and the number of schools has doubled.

The government has increased the education budget 356 percent, making it one of the few central governments in the world spending more on schools than on defense.

The right to a free public education was one of the key issues of the seven-year guerrilla war that led to the collapse of white rule and was a major campaign plank for Mugabe in the 1980 preindependence election.

Honoring that commitment has made Mugabe popular among the black majority. On July 5, Mugabe won a landslide victory in the first national election since he came to power in 1980.

"We decided from the beginning that education was not a privilege but an inherent right, and we opened it up for everybody," said Sen. Joseph Culverwell, deputy minister of education and himself an educator with 27 years of experience.

But the transformation of Zimbabwe's schools has caused a host of problems that have set parents against educators, government against some of its constituents and whites against blacks.

The rapid expansion has cost this Third World nation enormous sums of money, and some claim the growth has been accompanied by a decline in quality. Also, the new educational system has raised expectations that may trigger a rural exodus to Zimbabwe's cities, something the government is desperate to avoid.

The school system Zimbabwe inherited from the white-ruled nation called Rhodesia was racially segregated and inherently unequal. Although the white population was less than 5 percent, white schools received more than half the annual education budget. These schools averaged one teacher for every 15 pupils; in the black schools, the ratio was one teacher for 44 students.

Black aspirations gave the new government a mandate for massive change. The first two years of independence saw a spurt of economic growth that helped finance the program. The government built several hundred primary and secondary schools in rural areas, where at least half of the few existing schools had been destroyed during the war. The government also introduced "hot seating" -- doubling up on classroom use with two shifts of pupils and teachers.

But the vast expansion of the system has meant a sharp decrease in the proportion of qualified teachers. In 1979, there were 18,000 primary school teachers and all but 10 percent were graduates of training programs. Now there are 54,000 primary school teachers and nearly half are untrained.

The government is training 3,000 new teachers each year, thanks in part to funds from western donors including the United States, which built a $20 million teachers' college that opened this year. Nonetheless Zimbabwe is forced to employ more than 1,300 foreigners to fill the manpower gap.

A wide gap exists between long-established urban schools and their newer, poorer rural counterparts. Ministry of Education statistics show teacher-student ratios are often twice as large in rural schools than in urban ones.

That gap may widen as the government moves to decentralize the system and pushes the burden of financing onto local governments. While the move gives parents more control over their schools, it also threatens to compound the same kind of disparities between rich districts and poor ones that have plagued the United States.

Another problem is that the supposedly free school system has become one where families pay as much as $200 per year for fees, clothing and educational materials -- a huge sum in a country where most rural families earn less than $700 annually.

The government is seeking to create a school system that will teach socialism and self-reliance to its predominately rural population. But for many African parents, education is something else -- a means of economic mobility and escape from rural poverty to urban prosperity.

A western aid specialist said, "One of the biggest constraints is that parents still hold very dear the preindependence idea of education. The average black Zimbabwean wants his kid to go to the same school and get the exact same education the average white kid got."

Trapped by those aspirations, the government has tried to promote both quality and quantity with limited success. The most sobering moment came earlier this year when officials announced results of the 1984 Cambridge "O" level exams -- the equivalent of a high school graduation test.

Only one-third of those who took the exams passed and only 56 percent of the successful candidates scored the equivalent of "C" or above.

Some critics said the high failure rate resulted because British-designed exams were used to rate Zimbabwean pupils. But Mugabe called the results "appalling" and blamed the shortage of qualified teachers.

"We have lacked teachers with the requisite training and background to assure that the quantitative expansion of the system was matched by a corresponding qualitative improvement," Mugabe said in a speech.

At Lord Malvern secondary school, headmaster Dry is committed to providing both. But Dry is dealing with an enrollment that has tripled during the past two years, increasing class sizes here by 50 percent. A school built to hold a maximum of 800 pupils now holds 500 extra ones, and music rooms, kitchens and auditoriums have been pressed into service.

The color of the faces has changed here, but not the routine. Blacks now roam soccer and cricket fields where whites once cavorted. Uniforms are required, corporal punishment is an accepted part of the regimen, and teachers are still addressed as "sir" and "madam."

"We run a perfectly 19th-century institution," said Dry, a white South African who came here in the late 1950s. But Dry concedes he is fighting an uphill battle. Many of his students cannot afford fees or uniforms. Most do not speak English at home, but rather Shona, their native tongue. Yet all exams and classroom work are in English.

"Language is a tool, and if your tool is blunt and inadequate you've got a problem," said Dry. Like many educators here, Dry believes schools should be more vocationally oriented for the 99 percent of his students who will never go beyond high school.

Many whites have abandoned schools like Malvern, fleeing the influx of blacks and filling the country's private schools, many of which have two-year waiting lists. The government has reacted angrily, accusing some schools of doubling or tripling tuition fees in order to keep blacks out.

Last year Minister of Education Dzingai Mutumbuka issued an edict demanding that all private schools have a majority black enrollment within six months. He backed down after a howl of white protests, but education remains one of the thorniest issues between whites and blacks and is a major factor in fueling a white exodus from Zimbabwe.

Dry says he does not have time to worry about white flight anymore. "In the United States or Germany or Britain you can come out of school illiterate and the country can carry you," he said. "But this is a young, developing country and it can't. Our job is to try to see it doesn't have to."