South Africa signed an accord Thursday granting independence to South-West Africa, the continent's last colony, which will become the black-ruled nation of Namibia.

South Africa's foreign minister, R.F. Botha, signed the pact at U.N. Headquarters along with the foreign ministers of Cuba and Angola, who also pledged to send home 50,000 Cuban troops posted in Angola.U.S.-mediated negotiations over the past year led to the accords, which were witnessed by Secretary of State George P. Shultz, U.N. Secretary-General Javier Perez de Cuellar and other diplomats.

"The regional settlement concluded here today represents a momentous turning point in the history of southern Africa," Shultz said.

"With the independence of Namibia, Africa's last colonial question will have been resolved. As the guns fall silent across the borders of southwestern Africa, the world will look to the nations" of the region to resolve "their pressing internal matters through peaceful means," he said, referring to the civil war beween Angola's government and U.S.-backed rebels.

"The governments and individuals gathered in this place have truly given the world a special gift," said Shultz.

The agreement is for a one-year transition to independence for Namibia to begin April 1.

The pact calls for 3,000 Cuban troops to leave Angola by April 1, and for all of them to be gone by July 1, 1991. Half of the 50,000 soldiers are to pull out by Nov. 1, 1989, when Namibia is to hold its first free elections for a national assembly, under U.N. supervision.

Foreign Ministers Isidoro Malmierca of Cuba and Afonso van Dumen of Angola then signed an agreement under which 70 U.N. peacekeepers will monitor the Cuban withdrawal from Angola.

Cuba, Angola and the United Nations do not officially recognize that the two accords are linked.

South Africa insisted on the Cuban withdrawal in talks mediated by Chester Crocker, the U.S. assistant secretary of state for African affairs.