The South African government announced today that it plans to abolish laws prohibiting marriage and sexual relations between whites and nonwhites.

Making the announcement to the country's new racially compartmentalized Parliament, Home Affairs Minister Frederik W. de Klerk said legislation scrapping what he called "the most controversial laws on the South African statute book," would be enacted before the current session ends in July.

De Klerk said the government had decided to scrap the laws because it felt they were no longer "essential" for the preservation of group identity and because it was "committed to the goal of eliminating racial discrimination."

The announcement was widely applauded by religious leaders and the segregationist government's liberal critics, but rightist opponents denounced it as "irresponsible" and a step that would endanger the "national identity" of the ruling white Afrikaner minority.

At the other end of the political spectrum, black nationalists downgraded its importance, implying that it is a peripheral change designed to catch the headlines while the government continues to ignore the basic issue of political rights for the black majority.

The State Department said the United States was "heartened" by the South African moves toward repeal of "some of the most odious aspects of apartheid." The statement by spokesman Bernard Kalb said the move is "a step in the direction of a more just society, although we realize that much more needs to be done."

[The South African move and U.S. comment came as Senate and House committees scheduled new hearings starting this week on measures to impose extensive economic sanctions against South Africa because of its racial policies. Secretary of State George P. Shultz is scheduled to outline administration policy toward the area in a speech Tuesday to the National Press Club.]

The "sex laws," as they are collectively called, were enacted by the Afrikaner Nationalist government 36 years ago as a cornerstone of its segregationist doctrine of apartheid. Their rationale has been to preserve the "national identity" of the Afrikaners, who control the government and who are fearful of being "swamped and absorbed" by the black majority.

There have been thousands of prosecutions under the laws, with many cases of whites committing suicide rather than facing the social disgrace of a public trial.

Until recently, the Dutch Reformed Church, to which most Afrikaners belong, gave theological approval to the laws, but other faiths condemned them and announced their willingness to defy the laws by solemnizing mixed marriages. The Dutch Reformed Church changed its stance recently and announced that there was no scriptural justification for the laws.

President Pieter W. Botha first hinted four years ago at the possibility of abolishing the sex laws, but his government hedged through fear of a backlash from its deeply conservative white Afrikaner supporters.

It did, however, begin reducing the number of prosecutions as public opposition to the laws mounted, although 160 persons still were prosecuted under the immorality act, which prohibits interracial sex, last year.

After implying that the laws might be "unnecessary," Botha appointed an all-parties parliamentary commission to investigate the "implications" of scrapping them. When the commission recommended their repeal in February, however, the government still hesitated and appointed another commission from the new Parliament, which included members of the Colored, or mixed race, and Asian minorities.

Some observers believe this was a device to try to give credit for scrapping the laws to the new nonwhite legislators, who are having difficulty establishing credibility in their communities because of their participation in the country's segregationist system.

This second committee presented its report today, calling for the immediate repeal of the laws, which it said were racist and could not be justified "on scriptural or any other grounds." The committee's report included draft legislation rescinding the laws.

Announcing the government's acceptance of both the report and the draft legislation, de Klerk said it was taking the steps because it was committed to eliminating race discrimination. The government had drawn a distinction, he said, between matters that are essential to protection of group security and group identity, and those that "in the light of present and changing circumstances do not contribute materially in this regard."

Judged in this way, the sex laws are no longer essential, he added.

The government realized that mixed marriages could lead to social, educational and housing problems in South Africa's racially segregated society, the minister continued, but it felt that these were best left to parents and religious ministers to sort out, while matters such as where mixed couples would live could be sorted out administratively.

"The government feels it should not interfere prescriptively in the intimate emotional lives of people," de Klerk said.

Allan Hendrikse, a Colored member of Botha's Cabinet and leader of the new Colored chamber of Parliament, described the decision to scrap the laws as "evidence that apartheid is being dismantled." His Asian counterpart, Amichand Rajbanni, described it as "a giant practical step away from discrimination."

But Daan van der Merwe, a spokesman for the far right Conservative Party, said he "strongly regretted" the decision.

"It is an irresponsible step, which endangers national identity," van der Merwe said.