JOHANNESBURG, South Africa (AP) _ At least 1,000 soldiers and police sealed off and occupied a black township Sunday in the eastern Cape province to quell rioting. Three more blacks were reported killed overnight in new unrest.

The military operation began in Kwanobuhle township after police shot and killed a 27-year-old black man following the torching by arsonists of three houses belonging to policemen, a police spokesman said in Pretoria.

The body of a 48-year-old black man who was ''killed with sharp instruments'' also was found in the same township.

Police said sporadic rioting broke out in black townships near Johannesburg as well as in the eastern Cape. In Tsakane, east of Johannesburg, a black security guard fired on blacks trying to set fire to his house, killing one man and wounding another, the spokesman said.

Rivalry between anti-apartheid organizations also flared into violence, leaving at least three blacks dead in the eastern Cape since early Friday, including two children aged 3 and 5, activists said.

Kwanobuhle, near the white, industrial center of Uitenhage, has been the scene of persistent rioting in recent months.

Soldiers lined the streets a few yards apart, and police riot vehicles patrolled the township handing out pamphlets calling on residents to help restore law and order.

Roadblocks barred entry to outsiders. Reporters taken on a tour of Kwanobuhle said from 1,000 to 1,200 soldiers and police took part in the operation.

''Numerous requests were received by the South African police from law- abiding citizens for restoration of normal living conditions in the townships,'' said Adriaan Vlok, deputy minister of defense and law and order.

He said police acted after 17 black civilians were killed by other blacks last month. Attacks against blacks regarded as collaborators with the white- minority government have increased dramatically in recent months.

Vlok told reporters the soldiers and police ''were welcomed by the people, the decent blacks who want to live decent lives.''

Bitter fighting broke out in eastern Cape townships between followers of two major groups opposing the government - the United Democratic Front and the Azanian People's Organization, or Azapo, a black consciousness group.

Black reporters said three people killed Friday were victims of the in- fighting. Two black children, aged 3 and 5, perished in a fire started by blacks throwing a gasoline bomb into the home of an Azapo official, and another Azapo member was stabbed to death, news reports said.

The Democratic Front, considered the largest group in South Africa opposing apartheid, the government's racial separation policies, welcomes support from all races in the campaign for black rights. Azapo contends whites cannot play a leading role in the movement. The two groups have been at odds for years, but violence had been rare.

''There are running battles in the streets'' between members of the two groups, said one reporter who asked not to be identified.

The dispute has been simmering for weeks. Bishop Desmond Tutu, Anglican bishop of Johannesburg and winner of the 1984 Nobel Peace prize, tried to hold peace talks last week, but the rival groups chose not to attend.

The white-minority government says unrest since last September has killed more than 200 people. Private groups say more than 300 have died.