JOHANNESBURG, South Africa (AP) _ The rightward swing by South Africa's white voters alarmed black leaders and left liberals in disarray Thursday, while exuberant far-right victors pledged to seek tougher enforcement of apartheid laws.

''We have entered the dark ages of the history of our country,'' said Anglican Archbiship Desmond Tutu, the 1984 Nobel Peace Prize winner, reflecting the distress of many blacks at the results of Wednesday's parliamentary election.

Tutu predicted intensified protests by the voteless black majority and ''an escalation of oppression'' by officials from President P.W. Botha's National Party, which strengthened its hold on Parliament.

Botha, in a television interview, said the results should convey to the country's foreign critics that ''they cannot dictate to South Africa.''

The far-right Conservative Party won 22 seats and 26 percent of the votes, replacing the liberal Progressive Federal Party as the country's main opposition party.

The National Party, in power since 1948, won 123 of the 166 elected seats in the Parliament's dominant white chamber. The chamber has a total of 178 seats, including 12 apponted seats.

The Nationalists had 117 elected seats and the Conservatives 17 in the old Parliament.

The Progressive Federal Party was the main force in an informal liberal alliance which campaigned to abolish racially discriminatory laws and negotiate power-sharing with blacks. In a crushing rebuff by voters, it lost seven of its 26 elected seats to the National Party. Another moderate member of the alliance, the New Republic Party, lost four of its five seats, and seven of eight independents also lost.

''We will have to re-examine our role and function,'' said Progressive Federal Party leader Colin Eglin, who won his Cape Town seat. ''There is no doubting that this is a setback for the PFP.''

Tutu urged the party to withdraw from Parliament, saying such an action would underscore the contention of many blacks that their quest for political rights will never succeed in the legislative body.

Eglin blamed the reform party's poor showing on negative advertising by the National Party and ''biased and servile'' news coverage by the government- controlled South African Broadcasting Corp.

Responding to this charge, Alwyn Schlebusch, the Cabinet minister who oversees the broadcasting company, said the Progressives lost because voters perceived them as being tolerant of black radicals and unrest.

Botha, who called the election two years ahead of schedule, said he received a clear mandate from the whites to maintain security.

The president, who during the campaign vowed to resist majority rule and maintain segregated neighborhoods, also said the government would pursue reform that would be ''constitutional and gradual.''

Botha's government already has adopted some reforms, including repealing in 1986 the pass book laws and dozens of other restrictions on the movements of blacks, and in 1985 scrapping laws that banned interracial sex and marriage. Liberal critics said the reforms were too limited.

The National Party won 52.5 percent of the vote, down from 57 percent in the last white election in 1981.

The Conservative Party and another far-right party, the Reformed National Party, together received 29 percent of the votes - nearly double the far right's 1981 total.

The Reformed National Party lost its only seat.

Nearly 68 percent of the white electorate, or 2,057,811 voters, cast their ballots, a slight improvement over the 1981 turnout.

The Conservatives' Johannesburg regional chairman, Clive Derby-Lewis, said his party will demand that the government enforce racial segregation in housing and reinstitute the pass laws that restricted the migration of blacks to cities.

Conservative leader Andries Treurnicht said the results ''put us in a strong position for challenging the government on reform.''

The Progressive Federal Party and New Republic Party suffered heavy losses in Natal province, which analysts interpreted as a rebuke of their support for the KwaZulu-Natal Indaba - an unprecedented negotiation process which produced a controversial proposal for a multiracial, black-led government in Natal.

At stake in the election were the 166 elected seats in the 178-seat House of Assembly. As of last year, the National Party held 117 of the elected seats and 10 of the non-elected seats, the Progressive Federal Party had 26 elected seats and one non-elected seat, the Conservatives had 17 elected seats and one non-elected seat, the New Republic Party had five elected seats and the Reformed National Party had one elected seat.

Ten of the 12 appointive seats are filled by the president and the party with the most seats. The two parties with the next-largest showings each fill one seat by appointment.

The breakdown shifted slightly before the election because some seats were vacant and two Parliament members declared themselves independents.

The white chamber is dominant in the tricameral Parliament. The other two chambers are for Asians and people of mixed race.

Under apartheid, South Africa's system of racial segregation, the country's 24 million blacks have no vote in national affairs. By law and by custom, the 5 million whites control the economy and maintain separate districts, schools and health services.