Sen. Edward M. Kennedy (D-Mass.) received a mixed reception from South Africa's divided black community when he arrived here tonight for an eight-day tour that organizers hope will bolster the struggle against the white-minority government's system of racial segregation known as apartheid.

Radical blacks jostled him and chanted "Kennedy go home" as he walked through the Johannesburg Airport terminal, but later 300 persons gave him a singing, cheering welcome by candlelight when he arrived to spend the night at the home of Nobel laureate Desmond Tutu in the segregated township of Soweto, 15 miles outside the city.

Both Tutu and fellow pastor Allan Boesak, head of the World Alliance of Reformed Churches, who are Kennedy's cohosts, said in interviews that they hoped the senator's visit would give impetus to the struggle against apartheid by providing a vital link between antiapartheid campaigns here and in the United States.

Kennedy is thought to be the first foreign dignitary to stay overnight in the sprawling black ghetto of Soweto, which has been the scene of racial unrest during the past four months as black resistance to apartheid has intensified.

The South African security police appeared to try to stop him from doing so when they radioed a message to the convoy of cars taking the senator and six members of the Kennedy family from the airport to Soweto, warning that a mob had gathered outside Tutu's house.

After a roadside consultation, the family members and two press buses were sent back to Johannesburg, but Kennedy insisted on continuing into the ghetto. When he arrived there were no hostile demonstrators, only the welcoming crowd holding lighted candles and singing freedom songs.

Visibly moved by this reception, Kennedy told the crowd: "I give you the assurance that when I return to the United States, I will be a continuing force against apartheid and for human rights."

Kennedy's arrival comes just 18 years after his brother Robert made a similar visit, and the different reception he experienced was a measure of how black political views and attitudes toward the United States have changed.

Robert F. Kennedy was given a rapturous welcome wherever he went in the black townships. During a memorable tour of Soweto, he and his wife Ethel repeatedly were swamped by thousands of delighted blacks, whom he often addressed from the roof of his automobile.

Edward Kennedy is due to make a similar tour of the ghetto Sunday, when he is likely to run into more hostility.

Although the hostility is limited to a black-consciousness group called the Azanian People's Organization, it typifies a growth of radicalism and anti-Americanism in the black community.

Tutu and Boesak blame the Reagan administration for much of this anti-Americanism. They contend that the administration's policy of quiet diplomacy with South Africa, called "constructive engagement," has given blacks the impression that it tacitly supports the apartheid regime, and they note that not many distinctions are made by people here between different viewpoints within the United States.

"One of the things Kennedy will have to do is to convince black South Africans that there is America and America," Boesak said.

Tutu warned Kennedy in his welcoming address at the airport that he could expect some hostile demonstrations from blacks, and he apologized for this.

"You come to a country that has been deeply polarized by apartheid and injustice," Tutu said.

Describing Kennedy as "this very good friend of ours, this champion of human rights," Tutu said his purpose in inviting the senator to visit South Africa was so that "you can see with your own eyes what apartheid has done to God's children and to this wonderful country."

"We want you to visit the ghettos in which we live," he said. "We want you to visit the resettlement camps to which our people are sent. We want you to be able to meet some of our people who live under restriction."

Boesak, a mixed-race minister who is a key figure in an antiapartheid alliance called the United Democratic Front, said he hoped Kennedy's visit would enable him to "interpret what he has seen to the American people and make them see how crucial it is to put pressure not only on the administration there but on the government here."