The South African government acted unlawfully in failing to give the Dalai Lama an entry visa in time to attend the archbishop emeritus Desmond Tutu's 80th birthday celebrations, a court has ruled.

The supreme court of appeal's unanimous judgment strongly criticised the then home affairs minister, Nkosazana Dlamini-Zuma, an ex-wife of the president, Jacob Zuma, and now head of the African Union.

The government was accused of banning the Dalai Lama last year because of a fear of offending China. A furious Tutu, who had invited the Tibetan spiritual leader to deliver a lecture in Cape Town, likened the African National Congress (ANC) to its racial apartheid predecessor.

The Dalai Lama and others in his entourage had applied for visas through the South African high commission office in New Delhi, India, about two months ahead of the planned visit, the court in Bloemfontein heard.

Even though the application met all requirements, the South African government did not issue the visa and the Dalai Lama ultimately withdrew his application.

"What is justified by the evidence is an inference that the matter was deliberately delayed so as to avoid a decision," the ruling by judge Robert Nugent said. "It hardly needs saying that the minister is not entitled to deliberately procrastinate. Procrastination by itself establishes unreasonable delay."

Nugent acknowledged that pressure from China, a major trading partner with South Africa, played a part in the delays. The Dalai Lama wants increased autonomy for Tibet, the homeland from which he has been exiled since 1959. China accuses him of being a separatist.

"I accept that the proposed visit raised matters of high diplomatic importance, justifiably calling for consultation, advice and consideration," the judge ruled. "But that begs the question what time was required to complete that process."

However, the judge said he did not find any evidence that officials had plans to deny the visa outright.

Tutu welcomed the court's verdict. "An independent judiciary is one of the most critical cornerstones of a democracy," he said. "This finding of our appeal court reflects positively on our judiciary and our country.

"His holiness is the holiest person I have had the fortune to meet. He has endured more than 50 years in exile. His grace, magnanimity and lack of bitterness are truly remarkable."

Tutu added: "I look forward to seeing him again soon, and perhaps I will invite him to celebrate my 90th birthday."

Opposition politicians who brought the appeal said the verdict had upheld the rule of law in South Africa. Mosiuoa Lekota, president of the Congress of the People, said: "Any citizen who wishes to invite a friend from abroad cannot be pressurised by government not to do so. It is held that justice delayed is justice denied. Likewise procrastination purposefully pursued is unconstitutional and unlawful.

"How often must our law courts remind the ruling party to honour the constitution and recognise its supremacy in our legal framework?"

He added: "In taking a position to delay the processing of the Dalai Lama visa, the government denied archbishop Desmond Tutu his constitutional right to invite his holiness."

The response from the government's home affairs department was brief. "The department has noted the judgment handed down today by the supreme court of appeal on the Dalai Lama matter," said the deputy director general Jackie Mckay. "In line with our constitution, the department respects the ruling of the supreme court in this regard."