South African President Cyril Ramaphosa was booed at former Zimbabwean president Robert Mugabe's memorial at National Sports Stadium in Harare on Saturday.
Earlier the South African president had received a lukewarm applause when his arrival was announced at the Rufaro Stadium where the memorial service was being held.
Taking to the podium, Ramaphosa told the crowd that their former president had been a close ally and friend to South Africa's African National Congress.
"Mugabe was a friend of the ANC, a friend of the people of SA, who stood by us during our darkest hour and was unwavering [in] support when our people were suffering under the yolk of apartheid," Ramaphosa said to booes and jeers.
He said after being elected as South Africa's first democratically elected president, Nelson Mandela's first invitation to an African head of state was to Mugabe.
"He was a committed pan-Africanist, an African Hero. We remember the legacy of Mugabe and the sacrifices he personally made, we are grateful for this support."
The hostile reaction is on the back of xenophobic attacks against foreign nationals in South Africa.
The country has been gripped by sporadic violence across several provinces with Gauteng being the hardest hit.
Ramaphosa told the crowd he understood their reaction, and offered an apology and declaring that South Africa was open to all African nations.
"In the past two weeks, we as South Africans have been going through a challenging period. We have had acts of violence, some of which [were] directed at nationals of other countries. This has led to the deaths of some nationals from other countries, but the majority were South Africans," he said.
"I stand before you as a fellow African to express my regret and apologise for what has happened in our country. What has happened in South Africa goes against the principles of the unity of the African people that presidents Mugabe, Mandela, Tambo and the great leaders of our continent stood for.
"I stand before you fellow Zimbabweans and Africans, we are working very hard to teach South Africans to embrace people of all countries. I would like to thank you for the support that you offered us as South Africans at this difficult time.
"I want to say here today, South Africans are not xenophobic, not against nationals from other countries, we welcome people from other countries. We are working very hard and we are going to promote social cohesion … we want to embrace the spirit of unity that Mugabe worked for throughout his life."
The crowd at the stadium cheered and applauded when he offered an apology.
They cheered even louder when he finished off his tribute to Mugabe in Shona.