American-South African relations, which had improved over the last several months, have been jolted by a U.S. decision to revoke the visa of heavyweight boxing contender Kallie Knoetze.

The State Department's action has been condemned by persons ranging from the foreign minister to political leaders of antigovernment parties. The sports-minded South Africans are indignant that Knoetze, ranked the number two challenger to Muhammad Ali by the World Boxing Council, is being denied a chance to win big money and international recognition.

Knoetze, 25, had been scheduled to meet Bill Sharkey, an unranked American, in a nationally televised bout in Miami Beach Saturday. His appearance was challenged by civil rights leaders such as the Rev. Jesse Jackson.

The denial of a work permit to Knoetze was based on his conviction in South Africa of attempting to obstruct justice. Last year Knoetze, then a policeman, was fined $135 after he admitted putting pressure on a black family not to testify against a fellow policeman who was charged with assault.

A year prior to this incident, Knoetze was accused of having shot a 15-year-old black youth in the leg during a riot. The youth is now crippled.

[In Miami, a federal judge set a hearing for Thursday afternoon to decide whether the U.S. government unfairly revoked Knoetze's visa.]

While agreeing that the United States had the "technical" right to bar Knoetze from the country because of his court conviction, Foreign Minister Pik Botha said it was neither "just nor fair" to allow him to train at Miami and then refuse him the right to complete the fight.

Botha said the ban appeared to be "inspired by a political urge to take revenge" upon a South African because of South Africa's racial policies.

The act was considered certain to increase anti-American sentiment among whites and make it more difficult for Pretoria to cooperate with the Carter administration.

John Wiley, a member of Parliament and leader of the minor South African Party, said the government should retaliate "by closing down the U.S. information offices in our cities, which for years have been stirring up strife between black and white, and undermining the lawful authorities in the republic."

The decision to bar Knoetze was gleefully received in black townships. A high-ranking police official said he feared "it might create an emotional binge" setting off new black protests over South Africa's discriminatory laws.

The Knoetze incident comes ironically during a period of improved relations. The International Communications Agency, the U.S. information service, has been expanding its cultural center in the black township of Soweto outside Johannesburg. And for the first time in years, a Voice of America correspondent has been allowed to be based here full time.

There has been less criticism of the U.S. attitude toward South Africa since the visit of Secretary of State Cyrus Vance in October. The new prime minister, Pieter Botha, appears committed to bringing about independence to the territory of Namibia (Southwest Africa), a key objective of the United Nations.

American diplomats here deny that the United States is prepared to be patient with South Africa's racial policies if a peaceful solution is reached in Namibia, although a relaxation of diplomatic pressure for immediate racial change here probably would result.