A court has ruled the South African government acted unlawfully by dragging its heels on a failed visa application by the Dalai Lama to attend Desmond Tutu's 80th birthday last year.
The Supreme Court of Appeal said the home affairs ministry had "unreasonably delayed" its decision to grant the Tibetan spiritual leader and his entourage visas to attend the celebrations for the renowned rights activist.
"In so doing," the judge ruled that then minister Nkosazana Dlamini-Zuma had "acted unlawfully."
Pretoria's failure to grant the Lama a visa prompted widespread accusations it was pandering to its top trade partner China, which regards the Tibetan leader as a separatist and protests against his visits to foreign countries.
At the time, Tutu blasted the government as being "worse than the apartheid government".
The often outspoken retired archbishop on Thursday welcomed the court's finding as a positive reflection on the country and the independence of its courts.
Tutu also paid tribute to the Dalai Lama, a friend and fellow Nobel Peace Prize laureate, and hinted that another invitation could be on the cards.
"I look forward to seeing him again soon, and perhaps I will invite him to celebrate my 90th birthday."
It was the second time that Pretoria had denied the Dalai Lama entry, with a visa refused in 2009.
However, he had visited three times before that and was personally welcomed by former president Nelson Mandela.
Dlamini-Zuma, who is now head of the African Union, had argued that the visa applications were withdrawn while she was awaiting input from officials on the matter.
But the court pointed to politics having played a role in the ministry's tardy response.
"The proposal raised serious concern that the visit by the Dalai Lama would put at risk the friendly relations between this country and the government of the People's Republic of China," wrote appeal court judge Robert Nugent.
The foreign ministry had also expressed its "reservations" due to South Africa's "One China Policy," which recognises Beijing as the legitimate government of China.
The court accepted that consultations and consideration on a visit of such diplomatic importance were justified, but it accused officials of "deliberate procrastination".
"A declaration that the visa had been refused is not warranted. What is justified by the evidence is an inference that the matter was deliberately delayed so as to avoid a decision," the ruling said.
The government said it would respect the ruling, but would "study the reasoning for the judgement before responding comprehensively."
The case was brought by leaders of the opposition in parliament after an initial challenge was thrown out of the High Court.
Mario Oriani-Ambrosini, a lawmaker for the Inkatha Freedom Party which brought the appeal, said the Dalai Lama had told him in April that he was keen to visit South Africa again.
"He wanted to come to South Africa to see President Mandela once more," said Oriani-Ambrosini.
The Dalai Lama has lived in exile in India since 1959, when he fled an abortive uprising against Chinese rule in Tibet.