Muhammad Ali on Friday paid tribute to Nelson Mandela as a symbol of forgiveness.

The former heavyweight champion said Mandela inspired others to "reach for what appeared to be impossible."

From his hometown of Louisville, Ali joined in mourning the death of the former South African president.

The two, who shared a boxing background, met twice: once in South Africa and once in North America, said a spokeswoman for the Ali Centre in Louisville, Kentucky.

"What I will remember most about Mr Mandela is that he was a man whose heart, soul and spirit could not be contained or restrained by racial and economic injustices, metal bars or the burden of hate and revenge," Ali said in his statement. "He taught us forgiveness on a grand scale."

Mandela emerged from 27 years in prison to negotiate an end to white minority rule in South Africa. He later became the country's first black president.

"He inspired others to reach for what appeared to be impossible and moved them to break through the barriers that held them hostage mentally, physically, socially and economically," Ali said.

"He made us realize we are our brother's keeper and that our brothers come in all colors."

Among the exhibits at the Ali Centre is a photo of Ali and Mandela, their hands clenched into fists as if they're boxing.

It was taken during Ali's trip to South Africa, said Ronald DiNicola, Ali's longtime attorney who accompanied “The Greates” on the trip.

"Mandela was a former fighter, so there was a kindred spirit there," DiNicola said. "There was always that connection."

Thousands greeted Ali on his arrival in South Africa, he recalled. Ali's visit came as the country was mourning the assassination of Chris Hani, another anti-apartheid leader, who was killed in 1993. Ali visited Hani's family and attended the funeral, DiNicola said.

"It had a deep emotional impact on the mourners and the country that Muhammad happened to be there at that moment," he said. "It gave them, I think, a level of comfort."