The South African government announced today it has agreed to give two chunks of territory totaling about 1,800 square miles to the neighboring kingdom of Swaziland, ruled by 82-year-old King Sobhuza II.

The announcement met with an angry reaction from African leaders in the two regions, and could have wider political repercussions in the Organization of African Unity where Swaziland may be accused of abetting South Africa's racial policies.

Minister of Development Pieter G. Koornhof, who made the announcement, said a final agreement would be concluded soon between South Africa and Swaziland. The move would increase the size of Swaziland by about one-third.

The two pieces of territory involved are about 600 square miles of thhe Kangwane tribal homeland, a crescent of laland wrapped around Swaziland's northern and western boundaries, and a 1,200-square-mile region of the Kwazulu homeland called Ngwavuma.

Ngwavuma abuts Swaziland's southeastern border and runs through to the Indian Ocean, where it would give landlocked Swaziland a potential harbor.

Both chunks of land have been claimed by Sobhuza as part of the kingdom over which he says Swazi kings ruled in the 19th century.

Both regions are part of tribal homelands whose leaders refuse to accept independence, insisting on the right of their people to remain South Afr icans and be granted political rights in South Africa.

Giving the regions to Swaziland will have the same political result as if the homelands were dedclared independent. It will enable the South African government to denationalize more blacks and remove their claim to political rights in what it regards as "white" South Africa.

The government's ultimate aim, through homeland independence, is to make South Africa's 21 million blacks statutory foreigners and turn the 4.5-million whites into a de jure majority.