The African National Congress and the government, removing a serious threat to the South African peace process, ratified an agreement Friday that will end all ANC underground guerrilla activity and expedite the release of political prisoners.

The accord, heralded as a major breakthrough by both sides, was likely to significantly speed up the black-white negotiation process and pave the way for the removal of American sanctions against Pretoria."This will serve as a stimulus to the negotiation process," President Frederik W. de Klerk said. "Matters which stood in (our) way . . . have now been resolved."

De Klerk added that the spirit of the talks reflected "a genuine desire on both sides to solve difficult problems sensibly. It bodes well for the road ahead."

Pallo Jordan, chief ANC spokesman, said that the pact was "a step in the right direction." And he agreed that it could "bring negotiations onto the agenda much more quickly than expected."

The agreement, ratified by the ANC and the government and released Friday, was reached Tuesday in an all-day meeting between de Klerk and ANC Deputy President Nelson Mandela. The meeting had been called to resolve an impasse over an August agreement to suspend the ANC's armed struggle, free political prisoners and allow the safe return of political exiles.

Under the new accord, the ANC agreed that its military wing, Umkhonto we Sizwe (Spear of the Nation), would immediately stop training soldiers inside the country, halt the infiltration of men and materials and stop planning new underground operations. It also agreed to stop making "threats of armed action" as well as "statements inciting violence."

In exchange, the government agreed to allow the ANC to conduct mass demonstrations, such as those seeking the resignations of black township councilors, so long as the protests did not involve violence or intimidation. It also promised to step up the process of identifying and releasing political prisoners and of granting indemnity to exiles.