South African President Pieter W. Botha, speaking against a backdrop of growing challenge to his government's apartheid policies, told a special session of Parliament today that he has ordered "appropriate steps to be taken to restore and maintain law and order."

Botha did not indicate what the action would be, but his statement to a joint session of the tricameral Parliament led to widespread speculation that there might be a spate of bannings or detentions directed against activists who his government believes are behind the current wave of racial unrest.

The president's statement was broadcast live on radio and television, with repeated rebroadcasts this evening, adding to the impression that it was intended as a prelude to some important announcement.

He was reported to have spent much of the day closeted with his law and order minister, Louis le Grange, and other security chiefs before making the statement.

Stressing that he is committed to reforming apartheid, as the country's segregationist system is called, Botha accused the demonstrators of trying to sabotage the reforms to instigate revolution.

He said they wanted "to see the country go up in flames," to "bring South Africa to its knees" and to "solicit outside support for South Africa's destruction."

"They want chaos to reign in order that the international community and the United Nations can condemn South Africa as a threat to world peace," Botha said.

"I want to state clearly and categorically that they will not succeed," the president declared.

Botha has been showing signs of growing discomfort at being squeezed between reaction against his tentative reforms by his white Afrikaner supporters on one hand, and the combination of foreign threats of economic sanctions and what he regards as radical-inspired internal unrest on the other.

Botha's discomfort seems to have reached a crisis point with the fatal shooting by police of 19 black persons near the town of Uitenhage, in eastern Cape Province, last Thursday and the flood of angry protests this has unleashed.

Two more factors apparently have now added to the government's unease: evidence gathered by opposition members of Parliament indicating that the police version of what happened may be false and a protest march in defiance of the law yesterday, suggesting that a campaign of civil disobedience may be about to start.

Much of Botha's statement to today's special joint session of the racially separated parliamentary chambers was aimed at trying to keep them from debating the Uitenhage shooting.

Although Speaker Johan W. Greeff had ruled that the matter could be debated, Botha appealed to the legislators to drop the subject until the government's official inquiry was completed "for the sake of peace and for the sake of our commitment to the creation of a climate of good will."

But the main opposition party, the liberal Progressive Federal Party, rejected the president's request.

"Parliament cannot abdicate its responsibility," said Helen Suzman, one of the party's leaders, in a speech replying to Botha.

Botha also strongly criticized those who took part in yesterday's defiant march, warning that "the law is indivisible" and that no citizen could choose to obey only those laws he considered just.

In a possible signal that action might be taken against leading churchmen who have played a prominent role in the protests, Botha said, "It saddens me that certain people under the guise of moral and religious conviction should take the lead in fomenting disobedience, violence and destruction."

He also said: "It is ironic that now, at exactly the time that we have taken new initiatives, which encompass cooperation at so many levels and in so many spheres, people of ill intent instigate demonstrations and marches, which result in arson, violence and death."

Meanwhile, as intermittent violence continued in some of the black townships near Uitenhage and Port Elizabeth with two more black persons killed when police opened fire on a crowd attacking a house, the judge conducting the official inquiry into what happened last Thursday, Denis D. Kannemeyer, began his investigation by inspecting the scene of the shooting.

Contradictions with the official account given at the time appeared immediately. Whereas le Grange told Parliament that only one armored police vehicle had been at the scene, Kannemeyer said today police had told him there were two.

Le Grange's account to Parliament was that the commander of the police contingent, Lt. John Fouche, fired a warning shot into the ground next to the leader of a crowd of black demonstrators when they were five yards from the police vehicle, then ordered his men to open fire when they were surrounded and attacked.

According to Kannemeyer, Fouche told him today that he ordered the crowd to stop when they were 50 yards away, fired a warning shot at 10 yards and ordered his men to fire on the crowd when they were seven yards away.