The party on the extreme right of South Africa's white political spectrum narrowly won a seat in parliamentary by-elections, according to results announced early this morning. The upset victory over President Pieter W. Botha's ruling National Party reflected white discontent with the government's handling of black rebellion and the economy.

The Herstigte Nasionale, or Reconstituted National Party, took 51 percent of the vote in Sasolburg, a blue-collar industrial area about 60 miles south of Johannesburg, to capture its first seat in its 16 years of existence.

In 1981, during the last general election, the party, running against Botha's National Party, won only 34 percent of the vote in Sasolburg.

Botha's party held on to the four other seats at stake in yesterday's voting, although two of them with reduced margins.

The balloting was to fill midterm vacancies in the whites-only chamber that has the final say in the three-chamber Parliament.

Meanwhile, seven more blacks were killed -- six of them apparently by other blacks -- in a resurgence of the internecine killing that has been a feature of 14 months of political violence in this white-ruled country. There were reports that 56 more persons were arrested in the Cape Town area, where the government extended its state of emergency last weekend, in part to counter white fears that the violence is out of control.

The loss of the Sasolburg seat in no way threatens the numerical domination in the whites-only parliamentary body of Botha's ruling party, which controls more than two-thirds of the seats.

But the symbolism of the loss is certain to weigh heavily on South Africa's cautious white rulers and could slow further their tentative steps toward limited change. Government supporters had predicted confidently that their party would retain all five seats, though with reduced margins.

The rightist Reconstituted National Party, whose leaders railed against interracial sex and marriage and promised if they gained power to "unleash" the police and military against black opponents, squeaked by in Sasolburg with a 367-vote margin out of nearly 13,000 cast.

But the party's unambiguous message of white supremacy and racial purity clearly appealed to the attitudes and the pocketbooks of whites in the district, which is part of the traditionally conservative Orange Free State. The white population there is predominantly Afrikaner, the Dutch-descended ethnic group that has dominated this country politically since 1948.

Black townships in the area were the scene of the first violence, in September 1984, and white unemployment there has risen dramatically in recent months as South Africa's economy has nose-dived, due in large part to the violence and the resultant refusal by western creditors to make new loans.

Jaap Marais, leader of the Reconstituted National Party, played heavily on white anxieties concerning blacks and economic decline, contending that the West was stimulating rebellion to destroy white rule.

"They are using blacks against us in the same way as they used uitlanders [foreigners] to destroy the republics in Paul Kruger's day," Marais said at a political rally in Sasolburg Monday night, referring to the events that led to the Boer War and the defeat of two independent Afrikaner republics at the turn of the century.

The party also made an emotional issue of a local married couple of mixed race, contending that interracial liaisons would become rampant following the government's abolition of laws prohibiting mixed marriages and sexual relations.

Marais' party made a preelection deal with the larger Conservative Party of Andries Treurnicht, agreeing not to oppose each other's candidates in all but one of the five contests. Analysts believe that without votes from the Conservatives, who preach a slightly less virulent version of white supremacy and who welcome support from non-Afrikaner whites, Marais' party would not have won Sasolburg.

In the other Free State seat contested, Treurnicht's party was unable to match the Sasolburg upset. The National Party captured the largely rural Bethlehem seat with 55 percent of the vote. It was a sharp drop from the 74 percent the Nationalists captured there in 1981.

Botha and other leaders campaigned aggressively in the district, which has been represented by Nationalists since 1913.

Botha's party hung on to win with 46 percent of the vote in a three-way contest against both liberal and conservative opposition in Springs, another hard-hit industrial area east of Johannesburg. Even there, however, the party's percentage of support dropped greatly from 1981, when it took 64 percent in a two-way contest.

In Port Natal, in the relatively tranquil Natal Province, the ruling Nationalists won easily, taking 46 percent in a five-way contest.

In Vryburg, in rural northern Cape Province, the government candidate won with a comfortable margin of more than 1,000 votes out of about 8,000 cast.

Blacks and western critics have attacked Botha's government for its crackdown on opposition and the slow pace of its self-proclaimed program of reform. But in the small, insular world of white electoral politics that the balloting reflects, Botha's opposition has come largely from the other direction -- from right-wingers who contend that his government has been too willing to accommodate blacks.