South Africa's white political lineup appeared to be moving toward a new alignment today when 16 right-wing members of Parliament left the ruling National Party to protest any relaxation of apartheid, the country's strict racial segregation code.

In what was seen as another test of apartheid's popularity, the integrationist Progressive Federal Party tonight fell just one vote short of capturing a majority of the 47 council seats of this city, the country's largest.

Political analysts suggested that a "repolarization" is under way as South Africa's dominant white Afrikaners lose some of the cohesion that has made the National Party virtually unbeatable for more than three decades in the nation's whites-only elections.

The National Party split is the biggest since it came to power in 1948, and the first time since then that the government has had a formal opposition group on its right.

The 16 legislators, including two former Cabinet members who resigned their posts yesterday, rebelled against Prime Minister Pieter W. Botha's suggestion that his government may be prepared to give limited representation in Parliament to the country's 2.5 million Colored (persons of mixed race) minority.

The split will have no immediate impact on the National Party's control of Parliament. The prime minister, who first angered his party's right wing three years ago with speeches stating South Africa must "adapt or die," still can count on 126 of the Parliament's 177 seats.

The 16 crossed the floor of the House of Assembly in Cape Town at the opening of today's session, signaling their withdrawal from the National Party. But their leader, former minister for statistics and state administration Andries P. Treurnicht, told a press conference that he had no immediate plans to form a new party.

"We are independent Nationalists. We have no intention of being anything but Nationalists," he said. "We remain loyal to the National Party's principles and policies as approved by the party congresses."

Afrikaners number about 60 percent of South Africa's ruling white-minority population and for decades have maintained political control here. But differences between liberal and conservative factions over apartheid seem to be causing the Afrikaners' traditional cohesion to weaken.

The parliamentary split began Feb. 24, when 22 members of the majority party announced their opposition to any easing of the ban on Colored representation. But the prime minister won an overwhelming vote of confidence over Treurnicht at an emergency meeting of the party's ruling committee last Saturday, heading off what could have been a shattering split in the party.

After Saturday's victory, Botha gave the rebels until today to fall in line or be expelled from the party. Six backed down, but the rest declared their intention to split off.

The liberal Progressive Federal Party, which has been slowly gaining strength in parliamentary and municipal elections in the last decade, tonight scored its most significant triumphs since it was formed 23 years ago.

In final returns from Johannesburg's municipal election, the party won 23 of 47 city council seats, outpolling the ruling coalition of the National Party and independents, which took 21 seats.

To control the council, the party must woo at least one of the three votes held by minor parties and independents.

The party, which seeks the abolition of apartheid, also easily won control of Sandton and Randburg, two cities adjoining Johannesburg. In Randburg, the party won an 8 to 5 council majority, overturning the National Party's previous 11 to 2 hold.

Elsewhere the National Party also lost ground. While the party retained control of Pretoria, the national capital and one of the party's main strongholds, the right-wing Herstigte Nasionale Party won nine council seats and the Progressive Federal Party two. These were the first public offices ever won by the minority parties in the overwhelmingly Afrikaner capital.

For 13 years, the Progressive Federal Party struggled with only one member of Parliament, Helen Suzman. It now controls 27 seats and has become the official parliamentary opposition.

Lawrence Schlemmer, professor of sociology at Natal University and the country's leading opinion analyst, said he foresees more English support for the National Party as it loses its hard-line Afrikaners and becomes more moderate. At the same time he foresees more liberal Afrikaners joining the Progressive Federal Party.

The Progressive Federal Party's Afrikaner leader, Fredrik Van Zyl Slabbert, has predicted that in time this process will lead to a complete realignment of South African politics, with integrationists on one side and segregationists on the other. He said the rift would also divide whites anxious for a negotiated settlement with the country's black majority from hard-liners bent on trying to maintain white domination at all costs.